11 Apr
2016
11 Apr
'16
3:32 a.m.
On 04/10/2016 11:02 PM, Vladimir Batov wrote:
Phil,
Unfortunately you test below confirmed my suspicion. Now could you kindly explain how your library is better than:
template<typename T> struct manager { T* create(args) { all_.emplace_back(args); return &all_.back(); } void remove(T*) { ... }
std::list<T> all_; };
T* serves as your node_ptr -- all pointers are valid as long as its manager instance is around. What am I missing?
I am not sure if I understand the analogy correctly but I can see that remove() will have to do a linear search in the list, slowing down the performance in general.