Author
anonymous
over 5 years ago
Language
C++
Compiler
gcc 8.1.0
Options
Warnings
Don't Use Boost
C++17
-pedantic-errors
Author
anonymous
over 5 years ago
$ g++ prog.cc -Wall -Wextra -std=c++17 -pedantic-errors
prog.cc: In instantiation of 'struct param<0, char, int, float>':
prog.cc:21:41: required from here
prog.cc:8:21: error: static assertion failed: Index into parameter pack cannot be negative!
static_assert(i > 0, "Index into parameter pack cannot be negative!");
~~^~~
prog.cc: In instantiation of 'struct param<4294967294, float>':
prog.cc:10:52: recursively required from 'struct param<4294967295, int, float>'
prog.cc:10:52: required from 'struct param<0, char, int, float>'
prog.cc:21:41: required from here
prog.cc:10:52: error: invalid use of incomplete type 'struct param<4294967293>'
using type = typename param<i - 1, ts...>::type;
^
prog.cc:3:8: note: declaration of 'struct param<4294967293>'
struct param;
^~~~~
prog.cc: In function 'int main()':
prog.cc:21:43: error: invalid combination of multiple type-specifiers
typename param<0u, char, int, float>::type x = 'a';
^~~~
Exit Code:
1