https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68190

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Markus Trippelsdorf from comment #1)

Markus, could you please elaborate on your reference to LWG 103? At the moment
I see no relation to the code example. With acceptance of

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm

support for heterogeneous comparison had been added. But this still requires as
of Table 101 — Associative container requirements that

a.find(k)

and

a_tran.find(ke)

return the very same type set<>::iterator for a non-constant set object and the
expression

a.erase(q)

also shall have type set<>::iterator return type. The only option, that LWG 103
allows is that for a given implementation set<>::iterator and
set<>::const_iterator *could* be of the same type, but that is not the problem
here.

There is a different way to point out the problem here by replacing the last
code line containing the erase expression

    iter = s.erase(iter);

by the following two lines:

    auto iter2 = s.find(1);
    static_assert(std::is_same<decltype(iter), decltype(iter2)>::value, "");

This static assertion fails and just demonstrates that

a.find(k)

and 

a_tran.find(ke)

do have different return types.

Reply via email to