Yes I would. In modern C++ we use exceptions and RAII for automatic cleanup.
Exceptions have high cost so I don't see where you are coming from. Rust's RAII goes further along than C++'s. C++ is playing a game of catchup to steal the move semantics from Rust.
Re:Rust is more than safety
by olejorgenb on Wednesday December 28, 2016 @05:24PM
(#13274215)
According to http://stackoverflow.com/a/13836329/1517969 modern c++ exceptions are free when no throw occurs.
In addition, Rust Results/Options are free when no throw occurs. So the argument is moot.
No they aren't, you must issue a compare instruction to verify the result was successful.
Re:Rust is more than safety
by oconnor663 on Saturday January 07, 2017 @05:37PM
(#13347077)
Do you know whether branch prediction makes them effectively free, in places where the result is almost always successful?
Exception handling in C++ is absolutely zero-cost when no exception occurs. Look up the Itanium ABI. In Rust, even if no error occurs, the return value must still be checked.
Additionally, Move semantics were borrowed from C++, not the other way around.
In this sense Rust's error handling is just like C (though harder to forget to check). Would you say C++ is more efficient than C in error handling?