[Bug libstdc++/59508] std::find could use specialized container's find
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 16 17:45:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59508
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> Users can specialize std::set<UserDefinedType>::find to do something
> different, e.g. write to a file, and it must not do that if they call
> std::find.
>
> It's not a matter of whether the type is the library's iterator type or not.
Right. If, then std::find should not invoke std::set::find (or std::map::find
etc) but the library's internal function to search the rb tree.
Of course users might still provide specializations of std::find for particular
iterator types but that shouldn't be a problem I think.
More information about the Gcc-bugs
mailing list