nojhan / paradiseo

An evolutionary computation framework to (automatically) build fast parallel stochastic optimization solvers
https://nojhan.github.io/paradiseo/
Other
92 stars 33 forks source link

readFrom should be a free function to allow for EOT with constructors without arguments #51

Open nojhan opened 3 years ago

nojhan commented 3 years ago

Currently, readFrom is a member of eoSerial, thus it necessitate an existing instance to be called. This makes constructors without parameter mandatory, and is error prone. For instance, it allows some operators to create empty EOT instances (like when using resize) on the fly.

The fix would be to make readFrom free friend functions, in which one can instantiate with mandatory parameters, just like std::begin.