Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-04-02 12:15:45

From: "Gennadiy Rozental" <gennadiy.rozental_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.
> And you get basic_string design as a result.


> If user do not like default value for the trait. It's value should be set
> *externally* to the component definition. That is the major point I am
> trying to prove in regards to numeric_cast design and in thic generic
> discussion.

But what about the distinction that xxx_traits<T>, a class, is
being used as the Policy type in Foo? From Foo's perspective, it
has a Policy which its clients can define any way they like
within the constraints of what's expected of the policy. By the
same token, other code, even code within Foo can use
xxx_traits<T> to get information. (Foo could do it regardless of
the type corresponding to the template argument Policy.)

Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at, gregod at, cpdaniel at, john at