On 03/01/2016 12:00 AM, Phil Bouchard wrote:
I've refactored most of the internal algorithms of block_ptr<> and now it is much more robust. The following example works pretty well: https://github.com/philippeb8/block_ptr/blob/master/example/block_ptr_test1....
The next step is to support Boost.Containers: https://github.com/philippeb8/block_ptr/blob/master/example/block_ptr_test2....
But after debugging the code it looks like the allocator is not used to instantiate the nodes and I do not see how it is used by looking at the code:
template
struct list_node : public list_hook<VoidPointer>::type { private: //list_node(); public: typedef T value_type; typedef typename list_hook<VoidPointer>::type hook_type;
T m_data;
T &get_data() { return this->m_data; }
const T &get_data() const { return this->m_data; } };
Am I missing something?
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.