[Bug libstdc++/68190] [5/6 Regression] iterator mix up with set::find and heterogenous lookup

howard.hinnant at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 3 15:27:00 GMT 2015


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

--- Comment #9 from Howard Hinnant <howard.hinnant at gmail dot com> ---
Untested fix suggested:

#if __cplusplus > 201103L                                                       
      template<typename _Kt>                                                    
        auto                                                                    
        find(const _Kt& __x) -> decltype(iterator{_M_t._M_find_tr(__x)})        
        { return iterator{_M_t._M_find_tr(__x)}; }                              

      template<typename _Kt>                                                    
        auto                                                                    
        find(const _Kt& __x) const ->
decltype(const_iterator{_M_t._M_find_tr(__x)})                                  
        { return const_iterator{_M_t._M_find_tr(__x)}; }                        
#endif


More information about the Gcc-bugs mailing list