
22 Oct
2007
22 Oct
'07
6:57 p.m.
I have a map, declared as: typedef std::pair<int, HintPage *> PageCachePair; typedef boost::fast_pool_allocator<PageCachePair> PageCacheAllocator; typedef std::map<int, HintPage *, std::less<int>, PageCacheAllocator> PageCache; The problem is when I try to call: boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(PageCachePair)>::purge_memory(); This always returns false. The real problem (of course) is that sizeof(PageCachePair) is incorrect. The real size is determined by the rebind mechanism for the actual map node struct. However, I have no idea how to portably determine that size. Is it even possible to do this? Scott