Skip to content

Comment on Show HN: Cppmatch – Rust-Like Pattern Matching and Error Handling for C++

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...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.