Author
anonymous
over 4 years ago
Language
C++
Compiler
gcc 10.1.0
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
prog.cc: In instantiation of 'void my_algo(Container&&) [with Container = myns::my_struct&]':
prog.cc:27:13: required from here
prog.cc:21:38: error: no match for call to '(const std::ranges::__cust_access::_Begin) (myns::my_struct&)'
21 | [[maybe_unused]] auto first = begin(rng); // my_structに対しては呼び出しが不適格、コンパイルエラー
| ~~~~~^~~~~
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:54,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39,
from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/range_access.h:400:2: note: candidate: 'constexpr auto std::ranges::__cust_access::_Begin::operator()(_Tp&&) const [with _Tp = myns::my_struct&]'
400 | operator()(_Tp&& __t) const noexcept(_S_noexcept<_Tp>())
| ^~~~~~~~
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/range_access.h:400:2: note: constraints not satisfied
prog.cc: In instantiation of 'constexpr auto std::ranges::__cust_access::_Begin::operator()(_Tp&&) const [with _Tp = myns::my_struct&]':
prog.cc:21:38: required from 'void my_algo(Container&&) [with Container = myns::my_struct&]'
prog.cc:27:13: required from here
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/range_access.h:400:2: required by the constraints of 'template<class _Tp> requires (__maybe_borrowed_range<_Tp>) && ((is_array_v<typename std::remove_reference<_Tp>::type>) || (__member_begin<_Tp>) || (__adl_begin<_Tp>)) constexpr auto std::ranges::__cust_access::_Begin::operator()(_Tp&&) const'
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/range_access.h:398:4: note: no operand of the disjunction is satisfied
397 | requires is_array_v<remove_reference_t<_Tp>> || __member_begin<_Tp>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398 | || __adl_begin<_Tp>
| ^~~~~~~~~~~~~~~~~~~
prog.cc: In instantiation of 'void my_algo(Container&&) [with Container = myns::my_struct&]':
prog.cc:27:13: required from here
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
Exit Code:
1