Author
anonymous
almost 5 years ago
Language
C++
Compiler
gcc 10.1.0
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
Author
anonymous
almost 5 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 function 'int main()':
prog.cc:15:20: error: no matching function for call to 'List<int>::List(int, int)'
15 | List<int>(1, 10); // not iterators
| ^
prog.cc:7:4: note: candidate: 'List<T>::List(II, II) [with II = int; T = int]'
7 | List(II first, II last) {}
| ^~~~
prog.cc:7:4: note: constraints not satisfied
In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stl_iterator_base_types.h:71,
from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iterator:61,
from prog.cc:1:
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/iterator_concepts.h: In instantiation of 'List<T>::List(II, II) [with II = int; T = int]':
prog.cc:15:20: required from here
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/iterator_concepts.h:522:13: required for the satisfaction of 'input_or_output_iterator<_Iter>' [with _Iter = int]
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/iterator_concepts.h:544:13: required for the satisfaction of 'input_iterator<II>' [with II = int]
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/iterator_concepts.h:523:9: in requirements with '_Iter __i' [with _Iter = int]
/opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/iterator_concepts.h:523:33: note: the required expression '* __i' is invalid
523 | = requires(_Iter __i) { { *__i } -> __detail::__can_reference; }
| ^~~~
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
prog.cc:4:8: note: candidate: 'constexpr List<int>::List(const List<int>&)'
4 | struct List
| ^~~~
prog.cc:4:8: note: candidate expects 1 argument, 2 provided
prog.cc:4:8: note: candidate: 'constexpr List<int>::List(List<int>&&)'
prog.cc:4:8: note: candidate expects 1 argument, 2 provided
prog.cc: In instantiation of 'List<T>::List(II, II) [with II = std::_List_iterator<int>; T = int]':
prog.cc:13:33: required from here
prog.cc:7:12: warning: unused parameter 'first' [-Wunused-parameter]
7 | List(II first, II last) {}
| ~~~^~~~~
prog.cc:7:22: warning: unused parameter 'last' [-Wunused-parameter]
7 | List(II first, II last) {}
| ~~~^~~~
Exit Code:
1