Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-03-07 07:11:46


From: "David Abrahams" <abrahams_at_[hidden]>

> 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.

Where Base is the iterator being adapted?

In the case where Base=int, _none_ of the defaults can be legally formed, so
we're back to providing a full-blown my_iterator_traits anyway, no?

What am I missing this time? :-) Perhaps there is a case where some of the
defaults are legal and the rest is not?

--
Peter Dimov
Multi Media Ltd.

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