I think a C++ library is "elegant" if the number of header files which must be included are as less as possible.
I know there have been existing fixed-size allocators like Loki::SmallObjectAllocator and boost::pool. Although both are excellent, I think they are not elegant and not easy to be seamlessly integrated into projects.
Most times, I only need a little part of boost library, but I have to install the whole library on my machine. For example, if I want to use boost::pool, I hope to just include ONE header file boost_pool.h and the work is done. Because I think a fixed-size allocator should not be so dependent on too many other components. In my opinion, ideal code should look like the following:
#include <boost_pool.h> int main() { boost::pool<int> p; int* v = p.allocate(); } Does there exist such a library?
boost_pool.h" - so, do the work once and put all related things in there? Seriously.BOOST_FOREACH, once you have them you wouldn't avoid using them just in order to make your boost component more stand-alone.