Why are structs not allowed in template definitions?
Posted
by nils
on Stack Overflow
See other posts from Stack Overflow
or by nils
Published on 2010-03-25T23:18:34Z
Indexed on
2010/03/25
23:23 UTC
Read the original article
Hit count: 302
The following code yields an error error: ‘struct Foo’ is not a valid type for a template constant parameter
:
template <struct Foo>
struct Bar {
};
Why is that so?
template <class Foo>
struct Bar {
};
works perfectly fine and even accepts an struct as argument.
© Stack Overflow or respective owner