David Fang wrote:
I might see what other template metaprogramming techniques have to offer. I'm only a newbie in this subject, still learning on the fly. I would be very interested to hear what solution you end up using.
The problem is we can't have template <template <class, class> class C> class container besides template <template <class> class C> class container. But in this case, I think we can just name the former diffently, for example container_with_allocator. The attached patch is a quick shot: on first sight it's uglier that what has been suggested before (writing template <template< class T, class A = std::allocator<T>
class C> class container, but it doesn't turn all container types into container-assuming-STL types.
It has the problem that it still fails to link and on gcc-4.2 it even fails to compile with very strange error mesages from the assembler. But, heck, who cares!? -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>