
From: David Abrahams <dave@boost-consulting.com>
I don't know; it seems to me that the
template <class T, class Policy = xxx_traits<T> > class Foo;
idiom might not be a bad one for some uses if xxx_traits is only supplying associated types. It allows customization of the meaning of Foo<X> for any X by specializing xxx_traits<X>, while also allowing users to explicitly choose Foo<X, Y> when they don't like the default for X.
Right. The only problem arises when xxx_traits is used as the exemplar for the policy and not all of xxx_traits' interface is needed. That can be solved with documentation, but the tendency is likely to be to copy xxx_traits and modify its functionality when creating a new policy class. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;