Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-04-02 11:36:08


From: David Abrahams <dave_at_[hidden]>
>
> 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_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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