Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-07 07:18:18


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
> Isn't the above building the std::iterator_traits specialization? If so,
> what's wrong with
>
> struct my_iterator_traits: public default_const_iterator_traits<dummyT>
> {
> typedef std::forward_iterator_tag iterator_category;
> };
>
> The idea being that (only) the non-defaults are explicitly replaced by
> typedefs. The function case differs in that functions cannot inherit each
> other. :-)
>
> Perhaps I'm missing something...

You are. For one thing, the default type-expressions for some of the traits
can't always be legally formed. For example, the default Value is
iterator_traits<Base>::value_type. When Base = int, you've got a problem.

-Dave


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