
"For example, when defining a constant lvalue iterator, the user can pass a const-qualified version of the iterator's value_type as iterator_facade's Value parameter and omit the Reference parameter which follows." This no longer works in current gcc 4.3 (previous issue I mentioned was a compiler bug, now fixed): it works out to generating a const lvalue in operator[], which makes gcc-4.3 give "error: type qualifiers ignored on function return type" This is either a bug in boost or a bug in gcc; not being clear on which it really is, I'll file it under boost. -- BenoƮt

on Wed Nov 07 2007, "Benoit Hudson"
"For example, when defining a constant lvalue iterator, the user can pass a const-qualified version of the iterator's value_type as iterator_facade's Value parameter and omit the Reference parameter which follows."
This no longer works in current gcc 4.3 (previous issue I mentioned was a compiler bug, now fixed): it works out to generating a const lvalue in operator[], which makes gcc-4.3 give "error: type qualifiers ignored on function return type"
Surely that's a warning, not an error? Do you mean a const rvalue? A const lvalue is what vector<T>::operator[](size_type) const returns.
This is either a bug in boost or a bug in gcc; not being clear on which it really is, I'll file it under boost.
It's certainly legal and meaningful to return a const rvalue, so I'm very confused about your report. It sure sounds like a GCC bug, though. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

on Wed Nov 07 2007, "Peter Dimov"
David Abrahams:
It's certainly legal and meaningful to return a const rvalue, so I'm very confused about your report.
Only for a class type, see 3.10/9.
Oy, really? :( That's a silly nonuniformity, but I guess it points to a problem in the library. Benoit, I could attempt a fix, but I would really appreciate having a testcase that fails to compile before I try to fix the library. Can you open a Trac ticket at http://svn.boost.org and, if possible, attach a small example of code that reveals the problem? Thanks, -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (3)
-
Benoit Hudson
-
David Abrahams
-
Peter Dimov