
Michael Marcin wrote:
Steven Watanabe wrote:
AMDG
<snip>
Iteration seems like a good solution.
<snip>
Thanks! I'll give it a shot.
Well I tried it out, seemed to work fine except for the original problem. I added one extra function to the object_pool class: void destroy( const iterator& it ) { destroy( static_cast<T*>(static_cast<void*>(it.i)) ); } And then invoked my DestroyAll function with some items allocated from the pool which looks like: boost::object_pool<Object>::iterator it = m_object_pool.begin(); while( it != m_object_pool.end() ) { m_object_pool.destroy( it++ ); } The second iteration loops infinitely inside of template <typename SizeType> void * simple_segregated_storage<SizeType>::find_prev(void * const ptr); Not quite sure why. Thanks, Michael Marcin