id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 1996,"""void"" template specialisation for the pool allocators",Armin Felke,Chris Newbold,"It might be reasonable to add a template specialisation for the allocator classes ""pool_allocator"" and ""fast_pool_allocator"" with T=void? The library boost::multi_index, e.g., currently (version 1.35.0) uses the allocator notation in its generic code (expecting a ""default allocator""). In section 20.4.1 [lib.default.allocator] of the C++ standard the following specialisation is defined for class std::allocator as follows: template class allocator; // specialize for void: template <> class allocator { public: typedef void* pointer; typedef const void* const_pointer; // reference-to-void members are impossible. typedef void value_type; template struct rebind { typedef allocator other; }; }; In order to use the pool allocators with multi_index_container and ease generic programming, I would suggest the following additions to pool_alloc.hpp: template< typename UserAllocator, typename Mutex, unsigned NextSize> class pool_allocator { public: typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef pool_allocator other; }; }; template< typename UserAllocator, typename Mutex, unsigned NextSize> class fast_pool_allocator { public: typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef fast_pool_allocator other; }; }; Best regards Armin Felke ",Patches,closed,Boost 1.37.0,pool,Boost 1.35.0,Optimization,fixed,,