implicit conversion operator to the base scalar type for eoDualFitness (but is it a good idea?)
This commit is contained in:
parent
426c3584be
commit
ba5fe01ca0
1 changed files with 11 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Reference in a new issue