Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-06 19:31:39


David Abrahams wrote:
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
>>> Uh, wait. iterator_traits was not well designed, I'll grant you,
>>> but all the same, I'd call using iterator_traits<X>::reference to
>>> mean "the return type of *x" a definite no-no. Just think about the
>>> consequences of all those other type names in iterator_traits.
>>
>> Well, what else could it mean? :-)
>
> Leaving aside the fact that in real life it is underspecified and used
> inconsistently, it could mean "the return type of *x where x is an
> iterator."

One interesting example is that Lambda used iterator_traits<X>::reference in
exactly such a way, to infer the type of *x. I _almost_ put all the
iterator_traits<> type names in shared_ptr just to make it work.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net