Adjust code to perform to C++ standard according to gcc-3.4
interpretation... (Have not compiled/checked/changed paradisEO.) That is, the current code compiles with gcc-3.4 and the checks (besides t-MGE1bit) all pass.
This commit is contained in:
parent
faaadf7599
commit
85a326c5e4
35 changed files with 1057 additions and 864 deletions
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
-----------------------------------------------------------------------------
|
||||
eoExternalEO.h
|
||||
Definition of an object that allows an external struct to be inserted in EO
|
||||
Definition of an object that allows an external struct to be inserted in EO
|
||||
|
||||
(c) Maarten Keijzer (mkeijzer@mad.scientist.com) and GeNeura Team, 1999, 2000
|
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <EO.h> // EO
|
||||
|
||||
/**
|
||||
/**
|
||||
* Definition of an object that allows an external struct
|
||||
* to be inserted in EO. This struct or class can be of any
|
||||
* form, the only thing this class does is attach a fitness
|
||||
|
|
@ -40,28 +40,33 @@ class eoExternalEO : public EO<Fit>, virtual public External
|
|||
{
|
||||
public :
|
||||
|
||||
eoExternalEO(void) : EO<Fit>(), External() {}
|
||||
eoExternalEO(void)
|
||||
: EO<Fit>(), External()
|
||||
{}
|
||||
|
||||
/**
|
||||
Init externalEo with the struct itself and set fitness to zero
|
||||
*/
|
||||
eoExternalEO(const External& ext) : EO<Fit>(), External(ext) {}
|
||||
eoExternalEO(std::istream& is) : EO<Fit>(), External(ext) { readFrom(is); }
|
||||
/** Init externalEo with the struct itself and set fitness to zero */
|
||||
eoExternalEO(const External& ext)
|
||||
: EO<Fit>(), External(ext)
|
||||
{}
|
||||
|
||||
eoExternalEO(std::istream& is, const External& ext)
|
||||
: EO<Fit>(), External(ext)
|
||||
{ readFrom(is); }
|
||||
|
||||
/**
|
||||
* Read object, the external struct needs to have an operator>> defined
|
||||
*/
|
||||
virtual void readFrom(std::istream& _is)
|
||||
{
|
||||
virtual void readFrom(std::istream& _is)
|
||||
{
|
||||
EO<Fit>::readFrom(_is);
|
||||
_is >> static_cast<External&>(*this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write object. Called printOn since it prints the object _on_ a stream.
|
||||
* @param _os A std::ostream.
|
||||
*/
|
||||
virtual void printOn(std::ostream& _os) const
|
||||
virtual void printOn(std::ostream& _os) const
|
||||
{
|
||||
EO<Fit>::printOn(_os);
|
||||
_os << static_cast<const External&>(*this);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// eoString.h
|
||||
// (c) GeNeura Team, 1998
|
||||
/*
|
||||
/*
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
|
@ -26,7 +26,8 @@
|
|||
#define _eoString_H
|
||||
|
||||
// STL libraries
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
|
|
@ -38,13 +39,14 @@
|
|||
|
||||
/** Adaptor that turns an STL std::string into an EO */
|
||||
template <class fitnessT >
|
||||
class eoString: public EO<fitnessT>, public std::string
|
||||
class eoString: public EO<fitnessT>, public std::string
|
||||
{
|
||||
public:
|
||||
|
||||
typedef char Type;
|
||||
typedef char AtomType;
|
||||
typedef std::string ContainerType;
|
||||
typedef char Type;
|
||||
typedef char AtomType;
|
||||
typedef std::string ContainerType;
|
||||
|
||||
|
||||
/// Canonical part of the objects: several ctors, copy ctor, dtor and assignment operator
|
||||
//@{
|
||||
|
|
@ -58,7 +60,7 @@ public:
|
|||
EO<fitnessT>::printOn(os);
|
||||
os << ' ';
|
||||
|
||||
os << size() << ' ' << substr() << endl;
|
||||
os << size() << ' ' << substr() << std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -66,12 +68,12 @@ public:
|
|||
readFrom and printOn are directly inherited from eo1d
|
||||
*/
|
||||
//@{
|
||||
/** Inherited from eoObject
|
||||
/** Inherited from eoObject
|
||||
@see eoObject
|
||||
*/
|
||||
virtual std::string className() const {return "eoString";};
|
||||
//@}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Reference in a new issue