[Bug c++/71010] error: 'begin' was not declared in this scope
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 4 12:02:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71010
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Ubikovich from comment #3)
> But since C++14 cbegin invoke std::begin:
>
> // http://en.cppreference.com/w/cpp/iterator/begin
> template< class C >
> constexpr auto cbegin( const C& c ) -> decltype(std::begin(c));
> (3) (since C++14)
>
> Then in what namespace should be user-defined begin/end?
I already explained how to do it correctly, please read comment 1 again.
(In reply to Andrew Pinski from comment #4)
> In the same as the class so ADR (argument dependent resolution) can find it.
N.B. that should be ADL (argument dependent *lookup*).
More information about the Gcc-bugs
mailing list