B
Bob Hairgrove
Why can I do this:
template<typename A, typename B=A>
struct X { /*...*/ };
whereas this gives me an error about an undeclared identifier with
MSVC++ 7.1:
struct A
{ A(int arg1, int arg2=arg1); };
Now I know that the C++ standard says "you can't do that" (section
8.3.6 paragraph 9), but from a parsing standpoint, it seems like if
the compiler can handle the template parameter, it should have no
problem with the function parameter?
Thanks.
template<typename A, typename B=A>
struct X { /*...*/ };
whereas this gives me an error about an undeclared identifier with
MSVC++ 7.1:
struct A
{ A(int arg1, int arg2=arg1); };
Now I know that the C++ standard says "you can't do that" (section
8.3.6 paragraph 9), but from a parsing standpoint, it seems like if
the compiler can handle the template parameter, it should have no
problem with the function parameter?
Thanks.