Andrew Johnson wrote:
>
> places). In the above case, if no suitable comparison operator (cit !=
> it) exists then the compiler will automatically convert the RHS to cit and
> use (cit != cit).
>
Nope. That's my whole point. While the standard does allow for
explicitly converting an iterator to a const_iterator, there is no
special rule for implicit conversion, just the regular C++ rules
for resolving overloaded template functions. See section 14.8.3.
> My current list implementation allows either order in comparisons, but I
> could take out the (it == cit) operations if you really think this is
If your operators are friend functions, the only way this will compile
with HP's aCC is by explicitly casting; order is of no consequence:
(cit == (const_iterator)it), or ((const_iterator)it == cit)
On the other hand, if you define these operators as member
functions of iterator and const_iterator, there shouldn't be any
problem with template deduction.
Chris
--
Christopher A. Larrieu
Computer Scientist, Acc. Controls Group
Thomas Jefferson National Accelerator Facility
- References:
- C++ API backwards compatibility Jeff Hill
- Re: C++ API backwards compatibility Andrew Johnson
- Re: C++ API backwards compatibility Chris Larrieu
- Re: C++ API backwards compatibility Andrew Johnson
- Re: C++ API backwards compatibility Chris Larrieu
- Re: C++ API backwards compatibility Andrew Johnson
- Navigate by Date:
- Prev:
Re: C++ API backwards compatibility Andrew Johnson
- Next:
HP E2050A LanGpib gateway driver Mathew Rippa
- Index:
1994
1995
1996
1997
1998
1999
<2000>
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: C++ API backwards compatibility Andrew Johnson
- Next:
HP E2050A LanGpib gateway driver Mathew Rippa
- Index:
1994
1995
1996
1997
1998
1999
<2000>
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|