diff --git a/eo/src/eoReduce.h b/eo/src/eoReduce.h index 85675a6c..6a4143c3 100644 --- a/eo/src/eoReduce.h +++ b/eo/src/eoReduce.h @@ -214,8 +214,15 @@ public: // Now OK to erase some losers for (unsigned i=0; i(_newgen, t_size); - _newgen.erase(&eo); + //OLDCODE EOT & eo = inverse_deterministic_tournament(_newgen, t_size); + //OLDCODE _newgen.erase(&eo); + + // Jeroen Eggermont stdc++v3 patch + // in the new code from stdc++v3 an iterator from a container is no longer an pointer to T + // Because eo already contained a fuction using eoPop::iterator's we will use the following + + _newgen.erase( inverse_stochastic_tournament(_newgen.begin(), _newgen.end(), t_size) ); + } } private: @@ -259,8 +266,16 @@ public: // Now OK to erase some losers for (unsigned i=0; i(_newgen, t_rate); - _newgen.erase(&eo); + //OLDCODE EOT & eo = inverse_stochastic_tournament(_newgen, t_rate); + //OLDCODE _newgen.erase(&eo); + + // Jeroen Eggermont stdc++v3 patch + // in the new code from stdc++v3 an iterator from a container is no longer an pointer to T + // Because eo already contained a fuction using eoPop::iterator's we will use the following + + _newgen.erase( inverse_stochastic_tournament(_newgen.begin(), _newgen.end(), t_rate) ); + + } } diff --git a/eo/src/utils/compatibility.h b/eo/src/utils/compatibility.h index 405317ee..4d2f856e 100644 --- a/eo/src/utils/compatibility.h +++ b/eo/src/utils/compatibility.h @@ -32,7 +32,10 @@ #include #ifdef __GNUC__ -typedef ios ios_base; // not currently defined in GCC + // check for stdlibc++v3 which does have ios_base + #ifndef _CPP_BITS_IOSBASE_H + typedef ios ios_base; // not currently defined in GCC + #endif #endif #ifdef _MSC_VER diff --git a/eo/src/utils/eoParam.h b/eo/src/utils/eoParam.h index c0e2d428..47e68027 100644 --- a/eo/src/utils/eoParam.h +++ b/eo/src/utils/eoParam.h @@ -309,14 +309,14 @@ void eoValueParam >::setValue(std::string _valu template <> std::string eoValueParam >::getValue(void) const { - throw runtime_error("I cannot getValue for a vector"); - return string(""); + throw std::runtime_error("I cannot getValue for a vector"); + return std::string(""); } template <> void eoValueParam >::setValue(std::string) { - throw runtime_error("I cannot setValue for a vector"); + throw std::runtime_error("I cannot setValue for a vector"); return; } @@ -353,7 +353,7 @@ private : * See make_algo.h */ -class eoParamParamType : public std::pair > +class eoParamParamType : public std::pair > { public: eoParamParamType(std::string _value) @@ -361,7 +361,7 @@ public: readFrom(_value); } - ostream & printOn(ostream & _os) const + std::ostream & printOn(std::ostream & _os) const { _os << first; unsigned narg = second.size(); @@ -382,9 +382,9 @@ public: return _os; } - istream & readFrom(istream & _is) + std::istream & readFrom(std::istream & _is) { - string value; + std::string value; _is >> value; readFrom(value); return _is; @@ -400,16 +400,16 @@ public: return; } // so here we do have arguments - string t = _value.substr(pos+1);// the arguments + std::string t = _value.substr(pos+1);// the arguments _value.resize(pos); first = _value; // done for the keyword (NOTE: may be empty string!) // now all arguments - string delim(" (),"); + std::string delim(" (),"); while ( (pos=t.find_first_not_of(delim)) < t.size()) { size_t posEnd = t.find_first_of(delim, pos); - string u(t,pos); + std::string u(t,pos); u.resize(posEnd-pos); second.push_back(u); t = t.substr(posEnd); @@ -418,7 +418,7 @@ public: }; // at the moment, the following are defined in eoParser.cpp -ostream & operator<<(ostream & _os, const eoParamParamType & _rate); -istream & operator>>(istream & _is, eoParamParamType & _rate); +std::ostream & operator<<(std::ostream & _os, const eoParamParamType & _rate); +std::istream & operator>>(std::istream & _is, eoParamParamType & _rate); #endif