Language
C++
Compiler
gcc 11.1.0
Options
Warnings
Boost 1.76.0
C++11
-pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.76.0/gcc-11.1.0/include -std=c++11 -pedantic
Exit Code:
1
Author
anonymous
over 3 years ago
C++
gcc 11.1.0
Author
anonymous
over 3 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.76.0/gcc-11.1.0/include -std=c++11 -pedantic
prog.cc: In instantiation of 'constexpr MyVector<Name>::MyVector()':
prog.cc:23:20: required from here
prog.cc:16:11: error: no matching function for call to 'Name::Name(Name)'
16 | T x = T();
| ^~~
prog.cc:10:3: note: candidate: 'constexpr Name::Name()'
10 | Name() = default;
| ^~~~
prog.cc:10:3: note: candidate expects 0 arguments, 1 provided
prog.cc: In function 'int main()':
prog.cc:23:20: warning: unused variable 'n' [-Wunused-variable]
23 | MyVector<Name> n; //error with C++11 and C++14
| ^