Quantcast
Channel: Are new and delete still useful in C++14? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Yakk - Adam Nevraumont for Are new and delete still useful in C++14?

It is a relatively common choice to use make_unique and make_shared rather than raw calls to new. It is not, however, mandatory. Assuming you choose to follow that convention, there are a few places to...

View Article



Answer by Barry for Are new and delete still useful in C++14?

While smart pointers are preferable to raw pointers in many cases, there are still lots of use-cases for new/delete in C++14. If you need to write anything that requires in-place construction, for...

View Article

Answer by TheCppZoo for Are new and delete still useful in C++14?

I would say the only reason for new and delete is to implement other kinds of smart pointers.For example, the library still does not have intrusive pointers as boost::intrusive_ptr, which is a pity...

View Article

Answer by Mark B for Are new and delete still useful in C++14?

The only reason I can think of is that occasionally you may wish to use a custom deleter with your unique_ptr or shared_ptr. To use a custom deleter you need to create the smart pointer directly,...

View Article

Are new and delete still useful in C++14?

Given availability of make_unique and make_shared, as well as automatic deletion by unique_ptr and shared_ptr destructors, what are the situations (apart from supporting legacy code) for using new and...

View Article

Browsing all 5 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>