DEV Community

Discussion on: Pass-By-Value in C++ and Rust

Collapse
 
zhu48 profile image
Zuodian Hu • Edited

C++ has a move constructor for transferring ownership. Which, of course, forces you to learn that move semantics are a thing. But the tradeoff is more complexity for more control. Like any two languages, C++ and Rust are good for different things and different "feels".

Collapse
 
deciduously profile image
Ben Lovy

Yep, both languages let you use either semantics, the difference is the default. You're right, use the tool for the job.