Closed niniemann closed 6 years ago
Sorry, I messed up. This depends on #37 ! Wait for that one to be merged.
Maybe we should add the other operators, too, before merging this?
Which other operators did you mean in detail?
Comparisons. Less than, less or equal, greater than, greater or equal.
And yes some more operators sounds helpfully and fits in the context of this PR.
I've added the other comparison operators, and thought about implementing stuff like incrementation etc., too, but I'm not sure if/how to implement them properly in a generic way. So I'll just leave it as is for now.
This fixes #30 as good as possible, I think:
The first part of the issue cannot be resolved so easily, since I have no influence on the the assignment operator of
std::string
, which accepts different types, so that the compiler does not know which type it should cast ourRDFValue
to. The solution is to use thetemplate <class T> RDFValue::get()
method here (which is not new, but now works due to the removed const):The second part of the issue has to do with comparing values to entries in the
RDFPropertyMap
. I simply added thetemplate <class T> RDFValue::operator == (const T&)
which casts toT
and compares the result with the given value. With one exception to correctly compare withconst char*
.