This is great! Thanks for sharing, it is a cool idea to try bringing QoL improvements from Rust to C++. Got a question:
Does this prevent the RVO/NRVO compiler optimizations for return values? And when those fail, same question for the move-construction for types that do have a move constructor.
Comments
This is great! Thanks for sharing, it is a cool idea to try bringing QoL improvements from Rust to C++. Got a question:
Does this prevent the RVO/NRVO compiler optimizations for return values? And when those fail, same question for the move-construction for types that do have a move constructor.
RVO/NRVO are valid and are not affected.
We are dealing with std::variant, and the move semantics are defined by the alternative. https://en.cppreference.com/w/cpp/utility/variant/operator%3...