David Abrahams wrote: > My current working idea is really simple: > > struct impl1 { ... }; > struct impl2 { ... }; > > template <class T> > struct my_container : if_<is_pointer<T>, impl1, impl2>::type > { > ... > }; > > This is something I want to do all the time; it lets you swap out a > completely different implementation for the class (well, except for > the constructors) based on type properties. It also shows the > convenient interaction of type_traits metafunctions with MPL > algorithms.
OK, using this idea as a starting point... How about a generic algorithm to stream the contents of a standard container to cout [stream to cout is what HelloWorld is all about after all!], using is_pointer<T> to work out whether to de-reference the content of the iterator? -- AlisdairM _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost