N
nooneinparticular314159
I'm trying to do a template with specialization. I declare two
templates, one of which looks like:
template<int a, int b>
struct MOO
{
enum{
VALUE = b == 0 ? a: MOO<some stuff>::VALUE
};
};
template<>
struct MOO<int a, 0>
{
enum{VALUE = a};
};
The problem is, I get some compiler errors that don't make sense after
the second struct declaration:
1) Error: missing '>' to terminate the template argument list (where
is it missing from?!)
2) Error: wrong number of template arguments (1, should be 2). <---I
see two there. What am I missing?
3) Invalid type in declaration befre ',' token.
For 3, if I try declaring it as two numbers, say 0,0, it doesn't
complain about that. But I am trying to call the specialization with
an integer argument and a constant (0). What am I doing wrong?
Thanks!
templates, one of which looks like:
template<int a, int b>
struct MOO
{
enum{
VALUE = b == 0 ? a: MOO<some stuff>::VALUE
};
};
template<>
struct MOO<int a, 0>
{
enum{VALUE = a};
};
The problem is, I get some compiler errors that don't make sense after
the second struct declaration:
1) Error: missing '>' to terminate the template argument list (where
is it missing from?!)
2) Error: wrong number of template arguments (1, should be 2). <---I
see two there. What am I missing?
3) Invalid type in declaration befre ',' token.
For 3, if I try declaring it as two numbers, say 0,0, it doesn't
complain about that. But I am trying to call the specialization with
an integer argument and a constant (0). What am I doing wrong?
Thanks!