Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc 11.1.0

Options
Warnings
Boost 1.78.0
C++2b(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.78.0-gcc-11.1.0/include -std=gnu++2b
prog.cc: In function 'int main()':
prog.cc:8:20: error: no match for call to '(const std::ranges::__sort_fn) (std::__cxx11::list<int>&)'
    8 |   std::ranges::sort(list);
      |   ~~~~~~~~~~~~~~~~~^~~~~~
In file included from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/algorithm:64,
                 from prog.cc:2:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:2021: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'
 2021 |       operator()(_Iter __first, _Sent __last,
      |       ^~~~~~~~
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:2021:7: note:   template argument deduction/substitution failed:
prog.cc:8:20: note:   candidate expects 4 arguments, 1 provided
    8 |   std::ranges::sort(list);
      |   ~~~~~~~~~~~~~~~~~^~~~~~
In file included from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/algorithm:64,
                 from prog.cc:2:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:2034: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'
 2034 |       operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const
      |       ^~~~~~~~
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:2034:7: note:   template argument deduction/substitution failed:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_algo.h:2034:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/compare:39,
                 from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/stl_pair.h:65,
                 from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/stl_algobase.h:64,
                 from /opt/wandbox/gcc-11.1.0/include/c++/11.1.0/list:60,
                 from prog.cc:1:
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/concepts: 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::__cxx11::list<int>&; _Comp = std::ranges::less; _Proj = std::identity]':
prog.cc:8:20:   required from here
/opt/wandbox/gcc-11.1.0/include/c++/11.1.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-11.1.0/include/c++/11.1.0/bits/iterator_concepts.h:660:13:   required for the satisfaction of 'random_access_iterator<decltype (std::__detail::__ranges_begin(declval<_Container&>()))>' [with _Tp = std::__cxx11::list<int, std::allocator<int> >&]
/opt/wandbox/gcc-11.1.0/include/c++/11.1.0/bits/ranges_base.h:653:13:   required for the satisfaction of 'random_access_range<_Range>' [with _Range = std::__cxx11::list<int, std::allocator<int> >&]
/opt/wandbox/gcc-11.1.0/include/c++/11.1.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