From cc12fd27605df0828b18d30459c439d3c3a50fca Mon Sep 17 00:00:00 2001 From: okoenig Date: Tue, 28 Nov 2006 17:12:21 +0000 Subject: [PATCH] Added additonal definition for operator< between fitness and ScalarType. Needed for compilation with VS 8.0. --- eo/src/eoScalarFitnessAssembled.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eo/src/eoScalarFitnessAssembled.h b/eo/src/eoScalarFitnessAssembled.h index 8eacf0b2..9eb42a6c 100644 --- a/eo/src/eoScalarFitnessAssembled.h +++ b/eo/src/eoScalarFitnessAssembled.h @@ -209,7 +209,7 @@ public: os << FitnessTraits::getDescription(i) << " = " << operator[](i) << " "; } - // Comparison, using less by default + //! Comparison, using less by default bool operator<(const eoScalarFitnessAssembled& other) const{ if ( empty() || other.empty() ) return false; @@ -217,6 +217,12 @@ public: return Compare()( front() , other.front() ); } + //! Comparison with ScalarTypes. Explicit definition needed to compile with VS 8.0 + bool operator<(ScalarType x) const{ + eoScalarFitnessAssembled ScalarFitness(x); + return this->operator<(ScalarFitness); + } + // implementation of the other operators bool operator>( const eoScalarFitnessAssembled& y ) const { return y < *this; }