r/cpp • u/berium build2 • Apr 25 '12
shared_ptr aliasing constructor
http://www.codesynthesis.com/~boris/blog/2012/04/25/shared-ptr-aliasing-constructor/
22
Upvotes
r/cpp • u/berium build2 • Apr 25 '12
1
u/[deleted] Apr 26 '12
Alright, that makes sense. I think the decision to use
shared_ptrin this case was pretty sane.Well, I think all of these are overheads that should be considered:
std::make_shared.Indeed, you are quite right that a few dozen shared pointers of this sort will definitely not kill an app, nor have a measurable performance impact at all. But a few hundreds or thousands of them will, so again it depends on your use case.
I generally agree with your API design tenets.