A
awk
Hi,
is this valid C++ ? It compiles fine with msvc8 and intel 10, but not
with gcc 4.1 and 4.2.
template <int N>
struct foo
{
int c[N];
};
template <int N>
struct bar : foo<N>
{
bar(int x)
{
c[0] = x;
}
};
int main(int argc, const char* argv[])
{
bar<2> tmp(3);
return 0;
}
The error is:
In constructor 'bar<N>::bar(int)':
error: 'c' was not declared in this scope
regards,
Anders
is this valid C++ ? It compiles fine with msvc8 and intel 10, but not
with gcc 4.1 and 4.2.
template <int N>
struct foo
{
int c[N];
};
template <int N>
struct bar : foo<N>
{
bar(int x)
{
c[0] = x;
}
};
int main(int argc, const char* argv[])
{
bar<2> tmp(3);
return 0;
}
The error is:
In constructor 'bar<N>::bar(int)':
error: 'c' was not declared in this scope
regards,
Anders