implicit conversion operator to the base scalar type for eoDualFitness (but is it a good idea?)

This commit is contained in:
nojhan 2012-03-15 14:37:31 +01:00
commit ba5fe01ca0

View file

@ -103,6 +103,17 @@ public:
_is_feasible(dual.second)
{}
// FIXME is it a good idea to include implicit conversion here?
/** Conversion operator: it permits to use a fitness instance as its scalar
* type, if needed. For example, this is possible:
* eoDualFitness<double,std::less<double> > fit;
* double val = 1.0;
* fit = val;
* val = fit;
*/
operator BaseType(void) const { return _value; }
inline bool is_feasible() const
{
return _is_feasible;