|
Boost : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-04-02 11:11:31
"David Abrahams" <dave_at_[hidden]> wrote in message
news:uptaqlaqz.fsf_at_boost-consulting.com...
> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
>
> >> A trait is a part of the definition of an entity.
> >
> > That's right.
>
> Absolutely not. A key trait of traits is that they're non-intrusive.
> They create an association with that can be defined *after* the type
> argument is defined. See
> http://www.boost.org/more/generic_programming.html#traits
I do undersand that. But I still believe that trait specification is part of
definition. That is why I think that the best place for it is right after
"real" type definition. For example, for Solaris 4.2 compiler I am
frequently using construct like:
struct myType{};
template<>
is_pointer<myType*> { enum {value = true; } };
temaplte<>
iterator_traits<myType*> { ... };
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk