Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-19 17:55:35


----- Original Message -----
From: <williamkempf_at_[hidden]>
> >
> > I think that all general comments of using traits can be applied
> > here. For exmaple, using "mutex::lock" put a stronger requirement on
> > mutex type.
>
> I'm probably being dense, but I don't see how. Could you please
> illustrate with some code?

For the same reason that we have iterator_traits. You can't arrange for
built-in pointers to have type members (e.g. char*::iterator_category).
Traits are non-intrusive (see
http://www.boost.org/more/generic_programming.html#traits)

-Dave


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