|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-04-02 09:28:22
"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
>> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
>>
>> > Well, technically you maybe right, though it's quite difficult to
> imagine an
>> > example of that.
>>
>> char_traits is one.
>
> But If I understood you correctly in some other place you say that
> char_traits is an example of bad design.
Yes. That doesn't change the fact that it acts in both ways.
> And I think the same. IMO any example of trait/policy mixure in the
> same class would be an example of bad design.
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.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk