News for hackers. Stuff that matters.
Re:Show HN: Cppmatch – Rust-Like Pattern Matching and Error ... by j1elo on Sunday March 16, 2025 @09:20PM (#43384261)
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.

Re:Show HN: Cppmatch – Rust-Like Pattern Matching and Error ... by Rucadi on Monday March 17, 2025 @03:13AM (#43385908)
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...