Author
anonymous
over 4 years ago
Language
C++
Compiler
gcc HEAD 11.0.0 20201011 (experimental)
Options
Warnings
Boost 1.73.0
C++2a
no pedantic
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++2a
prog.cc: In function 'int main()':
prog.cc:22:50: error: no match for call to '(const std::ranges::__sort_fn) (std::vector<Package>&, <brace-enclosed initializer list>, void (Package::*)())'
22 | std::ranges::sort(packages, {}, &Package::foo);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:64,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2019:7: note: candidate: 'template<class _Iter, class _Sent, class _Comp, class _Proj> requires (random_access_iterator<_Iter>) && (sentinel_for<_Sent, _Iter>) && (sortable<_Iter, _Comp, _Proj>) constexpr _Iter std::ranges::__sort_fn::operator()(_Iter, _Sent, _Comp, _Proj) const'
2019 | operator()(_Iter __first, _Sent __last,
| ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2019:7: note: template argument deduction/substitution failed:
prog.cc:22:50: note: couldn't deduce template parameter '_Sent'
22 | std::ranges::sort(packages, {}, &Package::foo);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:64,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2032:7: note: candidate: 'template<class _Range, class _Comp, class _Proj> requires (random_access_range<_Range>) && (sortable<decltype(std::__detail::__ranges_begin((declval<_Container&>)())), _Comp, _Proj>) constexpr std::ranges::borrowed_iterator_t<_Range> std::ranges::__sort_fn::operator()(_Range&&, _Comp, _Proj) const'
2032 | operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const
| ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2032:7: note: template argument deduction/substitution failed:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2032:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_iterator_base_types.h:71,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_algobase.h:65,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:61,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h: In substitution of 'template<class _Range, class _Comp, class _Proj> requires (random_access_range<_Range>) && (sortable<decltype(std::__detail::__ranges_begin((declval<_Container&>)())), _Comp, _Proj>) constexpr std::ranges::borrowed_iterator_t<_Range> std::ranges::__sort_fn::operator()(_Range&&, _Comp, _Proj) const [with _Range = std::vector<Package>&; _Comp = std::ranges::less; _Proj = void (Package::*)()]':
prog.cc:22:50: required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:510:13: required for the satisfaction of '__indirectly_readable_impl<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type>' [with _In = std::projected<__gnu_cxx::__normal_iterator<Package*, std::vector<Package, std::allocator<Package> > >, void (Package::*>]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:530:13: required for the satisfaction of 'indirectly_readable<_I1>' [with _I1 = std::projected<__gnu_cxx::__normal_iterator<Package*, std::vector<Package, std::allocator<Package> > >, void (Package::*>]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:735:13: required for the satisfaction of 'indirect_strict_weak_order<_Rel, std::projected<_Iter, _Proj>, std::projected<_Iter, _Proj> >' [with _Rel = std::ranges::less; _Iter = __gnu_cxx::__normal_iterator<Package*, std::vector<Package, std::allocator<Package> > >; _Proj = void (Package::*]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:910:13: required for the satisfaction of 'sortable<decltype (std::__detail::__ranges_begin(declval<_Container&>())), _Comp, _Proj>' [with _Range = std::vector<Package, std::allocator<Package> >&; _Comp = std::ranges::less; _Proj = void (Package::*]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:510:42: in requirements [with _In = std::projected<__gnu_cxx::__normal_iterator<Package*, std::vector<Package, std::allocator<Package> > >, void (Package::*>]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:512:18: note: the required type 'std::iter_value_t<_In>' is invalid
512 | typename iter_value_t<_In>;
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:513:18: note: the required type 'std::iter_reference_t<_Tp>' is invalid
513 | typename iter_reference_t<_In>;
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:514:18: note: the required type 'std::iter_rvalue_reference_t<_In>' is invalid
514 | typename iter_rvalue_reference_t<_In>;
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:515:18: note: nested requirement 'same_as<std::iter_reference_t<const _In>, std::iter_reference_t<_Tp> >' is not satisfied
515 | requires same_as<iter_reference_t<const _In>,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
516 | iter_reference_t<_In>>;
| ~~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:517:18: note: nested requirement 'same_as<std::iter_rvalue_reference_t<const _In>, std::iter_rvalue_reference_t<_In> >' is not satisfied
517 | requires same_as<iter_rvalue_reference_t<const _In>,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518 | iter_rvalue_reference_t<_In>>;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
Exit Code:
1