2 ms·
You couldn't implement the standard library or libraries providing tools like the standard library without having "new" etc available in the language. And of co
by detaro 7y ago
You couldn't implement the standard library or libraries providing tools like the standard library without having "new" etc available in the language. And of course C++ hasn't had all of this from the start, some use cases still like or need to avoid using too much of the standard library, ...
- ncmncm 7y agoMost such cases are delusory. That said, anyone who needs more than a couple of std::shared_ptr in a program is probably Doing It Wrong. I rarely find a use for them; prevalence of std::shared_ptr is often called Java Disease. Similarly, for std::unique_ptr in public interfaces. Finally: implementers of the Standard Library are not confined to using only Standard facilities, so in fact they do not actually need op new. In practice, they use it, but always correctly so you don't typically need it at all.