Removed "using namespace std" statements from header files in EO -- "std::" identifier were added where necessary.
This commit is contained in:
parent
6441ea1ec3
commit
86fa476c67
263 changed files with 2009 additions and 1976 deletions
|
|
@ -66,7 +66,7 @@ class PyFitness : public boost::python::object
|
|||
extract<double> x(object::operator[](i));
|
||||
|
||||
if (!x.check())
|
||||
throw runtime_error("PyFitness: does not contain doubles");
|
||||
throw std::runtime_error("PyFitness: does not contain doubles");
|
||||
return x();
|
||||
}
|
||||
|
||||
|
|
@ -101,9 +101,9 @@ class PyFitness : public boost::python::object
|
|||
return other.operator<(*this);
|
||||
}
|
||||
|
||||
//void printOn(ostream& os) const { const object& o = *this; os << o; }
|
||||
//friend ostream& operator<<(ostream& os, const PyFitness& p) { p.printOn(os); return os; }
|
||||
//friend istream& operator>>(istream& is, PyFitness& p) { object o; is >> o; p = o; return is; }
|
||||
//void printOn(std::ostream& os) const { const object& o = *this; os << o; }
|
||||
//friend std::ostream& operator<<(std::ostream& os, const PyFitness& p) { p.printOn(os); return os; }
|
||||
//friend std::istream& operator>>(std::istream& is, PyFitness& p) { object o; is >> o; p = o; return is; }
|
||||
};
|
||||
|
||||
struct PyEO : public EO< PyFitness >
|
||||
|
|
@ -117,7 +117,7 @@ struct PyEO : public EO< PyFitness >
|
|||
void setGenome(object g) { genome = g; }
|
||||
object genome;
|
||||
|
||||
std::string to_string() const
|
||||
std::string to_std::string() const
|
||||
{
|
||||
std::string result;
|
||||
result += extract<const char*>(str(getFitness()));
|
||||
|
|
@ -131,7 +131,7 @@ struct PyEO : public EO< PyFitness >
|
|||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& os, const PyEO& _eo);
|
||||
std::ostream& operator<<(std::ostream& os, const PyEO& _eo);
|
||||
|
||||
struct PyEO_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,18 +30,18 @@ template <class T>
|
|||
struct T_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
static
|
||||
std::string print_to_string(const T& t)
|
||||
std::string print_to_std::string(const T& t)
|
||||
{
|
||||
std::ostrstream os;
|
||||
t.printOn(os);
|
||||
os << ends;
|
||||
os << std::ends;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
static
|
||||
boost::python::tuple getstate(const T& t)
|
||||
{
|
||||
std::string s = print_to_string(t);
|
||||
std::string s = print_to_std::string(t);
|
||||
return boost::python::make_tuple( boost::python::str(s));
|
||||
}
|
||||
|
||||
|
|
@ -54,14 +54,14 @@ struct T_pickle_suite : boost::python::pickle_suite
|
|||
}
|
||||
};
|
||||
|
||||
/** Defines persistency through pickle support by using strings
|
||||
/** Defines persistency through pickle support by using std::strings
|
||||
* so while we're at it, we will .def("__str__") as well
|
||||
*/
|
||||
template <class Persistent, class X1, class X2, class X3>
|
||||
boost::python::class_<Persistent, X1, X2, X3>& pickle(boost::python::class_<Persistent, X1, X2, X3>& c)
|
||||
{
|
||||
return c.def_pickle(T_pickle_suite<Persistent>())
|
||||
.def("__str__", T_pickle_suite<Persistent>::print_to_string);
|
||||
.def("__str__", T_pickle_suite<Persistent>::print_to_std::string);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue