
9 Feb
2011
9 Feb
'11
3:34 p.m.
On Sunday, February 06, 2011, Krzysztof Czainski wrote:
This looks like a very interesting drawback of make_shared, that never occoured to me. The deleter contains space for the allocated object inside itself, and is passed by value, therefore the allocated object must be small enough to fit on the stack, when using make_shared.
Is this a known thing (bug)?
https://svn.boost.org/trac/boost/ticket/4256 I think to fix it would require adding a special shared_ptr constructor for make_shared to use, which default constructs the deleter instead of copying the deleter in as a constructor argument.