https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431

--- Comment #8 from Antony Polukhin <antoshkka at gmail dot com> ---
Here's an idea:

Make valueless_by_exception() always false if all the alternatives are
trivially copyable. Implement copying and constructions/emplace for such
variants as a construction of a temporary + memcpy to destination. In theory
the compiler should eliminate the unnecessary copy.

Reply via email to