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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Nik Bougalis from comment #6)
> I don't follow why an auto return is used, instead of simply
> iterator/const_iterator which is the required return value per the
> documentation I've read.

Because doing that would make the functions declared unconditionally, which
would violate the standard. Using decltype means we get the SFINAE constraint
on the _M_find_tr function and so the overload is disabled when the comparison
function is not transparent, as required by the standard.

But it could be decltype(_M_t._M_find_tr(__x), iterator{}) which would still
check the constraint, and also return the correct type.

I can't test that until I'm home though.

Reply via email to