[yul-phaser] Population: Add operator+()

This commit is contained in:
cameel
2020-02-18 19:40:37 +01:00
committed by Kamil Śliwak
parent ecb30c670f
commit d9c5e2dc9f
3 changed files with 29 additions and 0 deletions
+8
View File
@@ -19,6 +19,7 @@
#include <tools/yulPhaser/Program.h>
#include <libsolutil/CommonData.h>
#include <libsolutil/CommonIO.h>
#include <algorithm>
@@ -117,6 +118,13 @@ void Population::run(optional<size_t> _numRounds, ostream& _outputStream)
}
}
Population operator+(Population _a, Population _b)
{
assert(toString(_a.m_program) == toString(_b.m_program));
return Population(_a.m_program, move(_a.m_individuals) + move(_b.m_individuals));
}
ostream& phaser::operator<<(ostream& _stream, Population const& _population)
{
auto individual = _population.m_individuals.begin();