Код: Выделить всё
#include
#include
#include
#include
#include
// template
template
struct Foo {
public:
float foo = 10.f;
};
template
void another() {
printf("another %d\n", C);
}
template
void bar(T&& b) {
static_assert(sizeof...(Args) == 0);
Foo{};
another();
}
struct BB {
int c = 10;
};
int main(){
constexpr int8_t a = 10;
Foo{};
Foo{};
float c = 11;
bar(c + 11);
}
Код: Выделить всё
:22:16: error: type/value mismatch at argument 1 in template parameter list for 'template struct Foo'
22 | Foo{};
| ^
:22:16: note: expected a constant of type 'int', got 'Args'
:22:16: note: so any instantiation with a non-empty parameter pack would be ill-formed
Подробнее здесь: https://stackoverflow.com/questions/792 ... ist-failed