fix broken rvalue-forward & SerialContainer assert

Release mode builds previously produced broken solutions with too many entries,
debug build triggered the assert

container.cpp:334: assert(solution.empty())

The standard guarantees std::vector(&&a) leaves a.empty() == true,
so the logic there is fine as long as subsolutions is actually
used for move-construction.
This commit is contained in:
v4hn 2018-11-06 12:11:37 +01:00
parent b9a86eb5be
commit b379ba2268

View File

@ -300,7 +300,7 @@ public:
: SolutionBase() : SolutionBase()
{} {}
SolutionSequence(container_type&& subsolutions, double cost = 0.0, StagePrivate* creator = nullptr) SolutionSequence(container_type&& subsolutions, double cost = 0.0, StagePrivate* creator = nullptr)
: SolutionBase(creator, cost), subsolutions_(subsolutions) : SolutionBase(creator, cost), subsolutions_(std::move(subsolutions))
{} {}
void push_back(const SolutionBase& solution); void push_back(const SolutionBase& solution);