diff --git a/eo/src/eoScalarFitness.h b/eo/src/eoScalarFitness.h index 31a9dbffe..6b09305ca 100644 --- a/eo/src/eoScalarFitness.h +++ b/eo/src/eoScalarFitness.h @@ -48,18 +48,19 @@ * Suitable constructors and assignments and casts are defined to work * with this quantity as if it were a ScalarType. */ -template +template class eoScalarFitness { public : + using ScalarType = SCALAR; eoScalarFitness() : value() {} eoScalarFitness(const eoScalarFitness& other) : value(other.value) {} - eoScalarFitness(const ScalarType& v) : value(v) {} + eoScalarFitness(const SCALAR& v) : value(v) {} eoScalarFitness& operator=(const eoScalarFitness& other) { value = other.value; return *this; } - eoScalarFitness& operator=(const ScalarType& v) + eoScalarFitness& operator=(const SCALAR& v) { value = v; return *this; } /** Conversion operator: it permits to use a fitness instance as its scalar @@ -69,27 +70,27 @@ class eoScalarFitness * fit = val; * val = fit; */ - operator ScalarType(void) const { return value; } + operator SCALAR(void) const { return value; } /// Comparison, using less by default bool operator<(const eoScalarFitness& other) const - { return Compare()(value, other.value); } + { return CMP()(value, other.value); } /// Comparison, using less by default // needed for MSVC 8 (MSVC 2005) added by J.Eggermont 20-11-2006 - bool operator<(const ScalarType& other) const - { return Compare()(value, other); } + bool operator<(const SCALAR& other) const + { return CMP()(value, other); } // implementation of the other operators - bool operator>( const eoScalarFitness& y ) const { return y < *this; } + bool operator>( const eoScalarFitness& y ) const { return y < *this; } // implementation of the other operators - bool operator<=( const eoScalarFitness& y ) const { return !(*this > y); } + bool operator<=( const eoScalarFitness& y ) const { return !(*this > y); } // implementation of the other operators - bool operator>=(const eoScalarFitness& y ) const { return !(*this < y); } + bool operator>=(const eoScalarFitness& y ) const { return !(*this < y); } private : - ScalarType value; + SCALAR value; }; /** @example t-eofitness.cpp *