https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65861
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- And even if they don't read the libstdc++ documentation, std::search doesn't work with input iterators, that's always been true: https://www.sgi.com/tech/stl/search.html http://en.cppreference.com/w/cpp/algorithm/search The code is simply broken and should be fixed.