Hacker News new | ask | show | jobs
by seritools 1465 days ago
`.clone()` is visible right in your code, though, unlike the implicit conversion/constructor magic.
1 comments

But you could write a C++ class with a manual .copy() method and a deleted copy constructor (and other conversion constructors not implemented).

Doing that seems a bit easier than integrating a whole new language into your project (although I know Rust would have other benefits).

You could do that if you are the author of std::string. Unfortunately, very few of us are.