Closed shierei closed 5 years ago
The reason that ponder::Value does not do implicit type conversion is because it does not implement 'operator T()'. Is there a reason not to implement it?
The comparison operators include ==, !=, >, <, >=, <=. ponder::Value only overloads operator == and <.
You can implement all of the other comparisons with the 2 supplied. We could add more though.
The reason that ponder::Value does not do implicit type conversion is because it does not implement 'operator T()'. Is there a reason not to implement it?
I removed it because I consider it bad programming practice. Implicit conversion can do some inadvertent/inefficient work if not understood.
I think we should add more to compare ponder::Value's. Otherwise the code would fail to compile if your code uses a comparison operator which is not == or <.
Enhancement merged. See #114.
The comparison operators include ==, !=, >, <, >=, <=. ponder::Value only overloads operator == and <. Camp works on all of them because camp::Value inherits boost::totally_ordered. I guess the way to work around this for ponder::Value is to overload all comparison operators.
I also find out that ponder::Value's implicit type conversion , i.e. the template method 'operator T()' does not do implicit type conversion for some reason. Camp can convert just fine but I do not know where the problem is from.