4 ms·
> What do you imagine is typologically wrong with new std::string("pjmlp")? You have to remember to `free` the string explicitely. > Yes, new is itself too lo
by masklinn 5y ago
> What do you imagine is typologically wrong with new std::string("pjmlp")?
You have to remember to `free` the string explicitely.
> Yes, new is itself too low-level, so std::make_unique("pjmlp"s) is the modern idiom
Is it? Isn't that going to create an `unique_ptr<char*>`?
- ncmncm 5y agoNope: https://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s https://en.cppreference.com/w/cpp/string/basic_string/operat... > You have to remember to `free` the string explicitly That is not a type problem. It is far from clear what pjmlp means here. unique_ptr should have been invented in 1985? Time machines have their own problems.