On 03/12/2015, Somnath Roy wrote: > I don't think make_shared / make_unique is part of c++11 (and ceph is using that). It is part of c++14 I guess.. std::make_shared is in C++11, std::make_unique is in C++14. In addition to performance, std::make_shared is also more correct, in that: std::shared_ptr<T>(new T) can leak object allocated by 'new T' if the allocation for the shared_ptr fails. std::make_unique is nice for cleanliness and symmetry, but doesn't add anything for performance or safety. (Also you can write your own make_unique, where make_shared is intimately involved with the details of shared_ptr.)
Attachment:
signature.asc
Description: PGP signature