Boost logo

Boost :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2007-10-22 14:57:40


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk