fix!(eoBit): defaults to char for scalar type

Since STL's vector of bool is not a vector of bool, `swap`ing bool elements in an eoBit can lead to errors.
Using `char` is a saner default.

Potential BREAKING CHANGE.
This commit is contained in:
Johann Dreo 2024-08-19 09:49:08 +02:00
commit 55b2f57d19
5 changed files with 9 additions and 9 deletions

View file

@ -41,7 +41,7 @@ template <class FitT>
class eoInitVirus: public eoInit< eoVirus<FitT> > {
public:
eoInitVirus(unsigned _combien, eoRndGenerator<bool>& _generator )
eoInitVirus(unsigned _combien, eoRndGenerator<char>& _generator )
: combien(_combien), generator(_generator) {}
virtual void operator()( eoVirus<FitT>& chrom)
@ -58,7 +58,7 @@ public:
private :
unsigned combien;
/// generic wrapper for eoFunctor (s), to make them have the function-pointer style copy semantics
eoSTLF<bool> generator;
eoSTLF<char> generator;
};
/// Inits the virus with one bit to the left set to one
@ -66,7 +66,7 @@ template <class FitT>
class eoInitVirus1bit: public eoInit< eoVirus<FitT> > {
public:
eoInitVirus1bit(unsigned _combien, eoRndGenerator<bool>& _generator )
eoInitVirus1bit(unsigned _combien, eoRndGenerator<char>& _generator )
: combien(_combien), generator(_generator) {}
virtual void operator()( eoVirus<FitT>& chrom)
@ -81,6 +81,6 @@ public:
private :
unsigned combien;
/// generic wrapper for eoFunctor (s), to make them have the function-pointer style copy semantics
eoSTLF<bool> generator;
eoSTLF<char> generator;
};
#endif