Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

Compiler

Options

Author

anonymous

almost 5 years ago

$
prog.cc: In function 'int main()':
prog.cc:8:24: error: no match for call to '(const std::ranges::__sort_fn) (std::__cxx11::list<int>&)'
    8 |   std::ranges::sort(lst);
      |                        ^
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:2018: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'
 2018 |       operator()(_Iter __first, _Sent __last,
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2018:7: note:   template argument deduction/substitution failed:
prog.cc:8:24: note:   candidate expects 4 arguments, 1 provided
    8 |   std::ranges::sort(lst);
      |                        ^
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:2031:7: note: candidate: 'constexpr std::ranges::borrowed_iterator_t<_Range> std::ranges::__sort_fn::operator()(_Range&&, _Comp, _Proj) const [with _Range = std::__cxx11::list<int>&; _Comp = std::ranges::less; _Proj = std::identity; std::ranges::borrowed_iterator_t<_Range> = std::conditional<true, std::_List_iterator<int>, std::ranges::dangling>::type]'
 2031 |       operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:2031:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/compare:39,
                 from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:65,
                 from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
                 from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts: In instantiation of 'constexpr std::ranges::borrowed_iterator_t<_Range> std::ranges::__sort_fn::operator()(_Range&&, _Comp, _Proj) const [with _Range = std::__cxx11::list<int>&; _Comp = std::ranges::less; _Proj = std::identity; std::ranges::borrowed_iterator_t<_Range> = std::conditional<true, std::_List_iterator<int>, std::ranges::dangling>::type]':
prog.cc:8:24:   required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:67:13:   required for the satisfaction of 'derived_from<typename std::__detail::__iter_concept_impl<_Iter>::type, std::random_access_iterator_tag>' [with _Iter = std::_List_iterator<int>]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/iterator_concepts.h:599:13:   required for the satisfaction of 'random_access_iterator<decltype (std::__detail::__ranges_begin(declval<_Container&>()))>' [with _Container = std::__cxx11::list<int, std::allocator<int> >&]
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/range_access.h:923:13:   required for the satisfaction of 'random_access_range<_Range>' [with _Range = std::__cxx11::list<int, std::allocator<int> >&]
/opt/wandbox/gcc-head/include/c++/11.0.0/concepts:67:28: note:   'std::random_access_iterator_tag' is not a base of 'std::bidirectional_iterator_tag'
   67 |     concept derived_from = __is_base_of(_Base, _Derived)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exit Code:
1