Re: Iterators: distance versus operator- argument types.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



rgamarra <rgamarra@xxxxxxxxx> writes:

> To check and see what's going on, I did
>
> g++ -E main.cc
>
> , got the full sources and modified the operator- by adding (with the
> proper #include <typeinfo>)

The operator- you mentioned before is the one for normal_iterator.  You
can see that it just calls operator- again on the base class.

The standard (at least, DR179) requires that operator- accept a
combination of iterator and const_iterator.  Since this version of
operator- is just going to call operator- again, it needs to accept
different types in the template.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux