Compile Error 0ms 0KiB
foo.cc: In function ‘int main()’:
foo.cc:13:15: error: ‘g’ was not declared in this scope
   13 |     do {cout<<g[0];
      |               ^
foo.cc:14:17: error: expected ‘;’ before ‘{’ token
   14 |     }while (d=a){
      |                 ^
      |                 ;
In file included from /nix/gcc/include/c++/13.2.0/algorithm:61,
                 from foo.cc:1:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
foo.cc:12:10:   required from here
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
 1822 |                 __val = _GLIBCXX_MOVE(*__i);
      |                 ^~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1824:15: error: invalid type argument of unary ‘*’ (have ‘int’)
 1824 |               *__first = _GLIBCXX_MOVE(__val);
      |               ^~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
 1822 |                 __val = _GLIBCXX_MOVE(*__i);
      |                 ^~~~~
In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:71,
                 from /nix/gcc/include/c++/13.2.0/algorithm:60:
/nix/gcc/include/c++/13.2.0/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]’:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1819:14:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
foo.cc:12:10:   required from here
/nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:16: error: invalid type argument of unary ‘*’ (have ‘int’)
   45 |       { return *__it1 < *__it2; }
      |                ^~~~~~
/nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:25: error: invalid type argument of unary ‘*’ (have ‘int’)
   45 |       { return *__it1 < *__it2; }
      |                         ^~~~~~
In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:61:
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1635:23:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
foo.cc:12:10:   required from here
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:344:11: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
  344 |           _ValueType;
      |           ^~~~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:346:11: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
  346 |           _DistanceType;
      |           ^~~~~~~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1638:19:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
foo.cc:12:10:   required from here
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:258:9: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
  258 |         _ValueType;
      |         ^~~~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:260:9: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
  260 |         _DistanceType;
      |         ^~~~~~~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:7: error: invalid type argument of unary ‘*’ (have ‘int’)
  263 |       *__result = _GLIBCXX_MOVE(*__first);
      |       ^~~~~~~~~
In file included from /nix/gcc/include/c++/13.2.0/bits/stl_pair.h:61,
                 from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:64:
/nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:19: error: invalid type argument of unary ‘*’ (have ‘int’)
  263 |       *__result = _GLIBCXX_MOVE(*__first);
      |                   ^~~~~~~~~~~~~
/nix/gcc/include/c++/13.2.0/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int; _ForwardIterator2 = int]’:
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:91:20:   required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1897:34:   required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1931:38:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
/nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
foo.cc:12:10:   required from here
/nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:12: error: invalid type argument of unary ‘*’ (have ‘int’)
  185 |       swap(*__a, *__b);
      |            ^~~~
/nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:18: error: invalid type argument of unary ‘*’ (have ‘int’)
  185 |       swap(*__a, *__b);
      |                  ^~~~

6 comments

  • @ 2024-12-12 16:58:01

    无敌

    • @ 2024-10-3 10:47:10

      编译器报错 哪道题

      • @ 2024-6-29 17:29:59

        6

        • @ 2024-4-21 8:36:31

          Compile Error 0ms 0KiB foo.cc: In function ‘int main()’: foo.cc:13:15: error: ‘g’ was not declared in this scope 13 | do {cout<<g[0]; | ^ foo.cc:14:17: error: expected ‘;’ before ‘{’ token 14 | }while (d=a){ | ^ | ; In file included from /nix/gcc/include/c++/13.2.0/algorithm:61, from foo.cc:1: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’ foo.cc:12:10: required from here /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits’ 1822 | __val = _GLIBCXX_MOVE(__i); | ^~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1824:15: error: invalid type argument of unary ‘’ (have ‘int’) 1824 | __first = _GLIBCXX_MOVE(__val); | ^~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits’ 1822 | __val = _GLIBCXX_MOVE(__i); | ^~~~~ In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:71, from /nix/gcc/include/c++/13.2.0/algorithm:60: /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]’: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1819:14: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’ foo.cc:12:10: required from here /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:16: error: invalid type argument of unary ‘’ (have ‘int’) 45 | { return __it1 < __it2; } | ^~~~~~ /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:25: error: invalid type argument of unary ‘’ (have ‘int’) 45 | { return __it1 < __it2; } | ^~~~~~ In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:61: /nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1635:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’ foo.cc:12:10: required from here /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:344:11: error: no type named ‘value_type’ in ‘struct std::iterator_traits’ 344 | _ValueType; | ^~~~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:346:11: error: no type named ‘difference_type’ in ‘struct std::iterator_traits’ 346 | _DistanceType; | ^~~~~~~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1638:19: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’ foo.cc:12:10: required from here /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:258:9: error: no type named ‘value_type’ in ‘struct std::iterator_traits’ 258 | _ValueType; | ^~~~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:260:9: error: no type named ‘difference_type’ in ‘struct std::iterator_traits’ 260 | _DistanceType; | ^~~~~~~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:7: error: invalid type argument of unary ‘’ (have ‘int’) 263 | __result = _GLIBCXX_MOVE(__first); | ^~~~~~~~~ In file included from /nix/gcc/include/c++/13.2.0/bits/stl_pair.h:61, from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:64: /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:19: error: invalid type argument of unary ‘’ (have ‘int’) 263 | __result = _GLIBCXX_MOVE(__first); | ^~~~~~~~~~~~~ /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int; _ForwardIterator2 = int]’: /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:91:20: required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1897:34: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1931:38: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’ foo.cc:12:10: required from here /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:12: error: invalid type argument of unary ‘’ (have ‘int’) 185 | swap(__a, __b); | ^~~~ /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:18: error: invalid type argument of unary ‘’ (have ‘int’) 185 | swap(*__a, *__b); | ^~~~ I see it,too.

          • @ 2024-4-10 17:50:58

            我看完了,内容如下

            Compile Error 0ms 0KiB
            foo.cc: In function ‘int main()’:
            foo.cc:13:15: error: ‘g’ was not declared in this scope
               13 |     do {cout<<g[0];
                  |               ^
            foo.cc:14:17: error: expected ‘;’ before ‘{’ token
               14 |     }while (d=a){
                  |                 ^
                  |                 ;
            In file included from /nix/gcc/include/c++/13.2.0/algorithm:61,
                             from foo.cc:1:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h: In instantiation of ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
            foo.cc:12:10:   required from here
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
             1822 |                 __val = _GLIBCXX_MOVE(*__i);
                  |                 ^~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1824:15: error: invalid type argument of unary ‘*’ (have ‘int’)
             1824 |               *__first = _GLIBCXX_MOVE(__val);
                  |               ^~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1822:17: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
             1822 |                 __val = _GLIBCXX_MOVE(*__i);
                  |                 ^~~~~
            In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:71,
                             from /nix/gcc/include/c++/13.2.0/algorithm:60:
            /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]’:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1819:14:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1859:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1950:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
            foo.cc:12:10:   required from here
            /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:16: error: invalid type argument of unary ‘*’ (have ‘int’)
               45 |       { return *__it1 < *__it2; }
                  |                ^~~~~~
            /nix/gcc/include/c++/13.2.0/bits/predefined_ops.h:45:25: error: invalid type argument of unary ‘*’ (have ‘int’)
               45 |       { return *__it1 < *__it2; }
                  |                         ^~~~~~
            In file included from /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:61:
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1635:23:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
            foo.cc:12:10:   required from here
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:344:11: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
              344 |           _ValueType;
                  |           ^~~~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:346:11: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
              346 |           _DistanceType;
                  |           ^~~~~~~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1638:19:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1910:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1926:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
            foo.cc:12:10:   required from here
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:258:9: error: no type named ‘value_type’ in ‘struct std::iterator_traits<int>’
              258 |         _ValueType;
                  |         ^~~~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:260:9: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
              260 |         _DistanceType;
                  |         ^~~~~~~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:7: error: invalid type argument of unary ‘*’ (have ‘int’)
              263 |       *__result = _GLIBCXX_MOVE(*__first);
                  |       ^~~~~~~~~
            In file included from /nix/gcc/include/c++/13.2.0/bits/stl_pair.h:61,
                             from /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:64:
            /nix/gcc/include/c++/13.2.0/bits/stl_heap.h:263:19: error: invalid type argument of unary ‘*’ (have ‘int’)
              263 |       *__result = _GLIBCXX_MOVE(*__first);
                  |                   ^~~~~~~~~~~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h: In instantiation of ‘void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int; _ForwardIterator2 = int]’:
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:91:20:   required from ‘void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1897:34:   required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1931:38:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:1947:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’
            /nix/gcc/include/c++/13.2.0/bits/stl_algo.h:4861:18:   required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = int]’
            foo.cc:12:10:   required from here
            /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:12: error: invalid type argument of unary ‘*’ (have ‘int’)
              185 |       swap(*__a, *__b);
                  |            ^~~~
            /nix/gcc/include/c++/13.2.0/bits/stl_algobase.h:185:18: error: invalid type argument of unary ‘*’ (have ‘int’)
              185 |       swap(*__a, *__b);
                  |                  ^~~~
            
            👍 1
            • @ 2024-3-31 15:09:11

              ???

              • 1