Closed tforgione closed 9 years ago
make_shared require ctors to be public.
Fair enough, thanks for answering so fast, and sorry for the inconveniance
Note that for the dev branch, the use of shared_ptr has been limited a lot.
There are ways to allow the use of make_shared with private ctors. We might use them in the near future.
Hi everyone,
I was browsing the source code of this repository, and I was wondering if there was a specific reason for using
instead of
CppReference says that the second one is faster since it makes only one memory allocation (for the ref counter) but the first version makes one allocation during the
new
creating theT
and another one in the constructor ofstd::shared_ptr
to allocate the ref count.Thanks in advance.