A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Sedeniono/tiny-optional/issues/4 below:

assert in move assign operator · Issue #4 · Sedeniono/tiny-optional · GitHub

The operator MoveAssignmentBase & operator=(MoveAssignmentBase && rhs) has this assert:

assert(this->has_value() == rhs.has_value());

It triggers in our code. The reason is that

this->AssignValue(std::move(rhs.GetPayload()));

might set rhs to the empty state if the moved-from-state happens to be the empty-state. I don't know what the assert is supposed to protect. It looks unnecessary. Could there be problems if I remove it?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4