On 03/01/2016 04:27 PM, Ion GaztaƱaga wrote:
On 01/03/2016 14:14, Phil Bouchard wrote:
Sorry I forgot that the header node is instantiated on the stack. Smart pointers pointing to objects on the stack doesn't work so therefore modifications to the Container API will be needed to support smart pointers.
Supporting embedded end pointers is not only an option, but the choice of most STL implementations. It makes default constructors nothrow and improves performance. Any smart pointer should support pointing to those end nodes or it's just broken for STL-like containers.
You're right. I think there's a way for block_ptr<> to support weak references and I will get rid of the strange pointer-on-the-heap initialization optimization at the same time. Regards, -Phil