mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Population: Add operator+()
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user