I think I stumbled over a bug in VC7.1 today, and now I see the same
behavior in VC8 beta.
Here is a simplified example:
template<class T>
struct Trait
{
typedef T& ref; // #1
};
class Foo
{
//typedef Trait<int>::ref ref; // #2
int i;
public:
operator Trait<int>::ref () { return i; }
};
// error on line #1
// error C2721: 'typedef' : storage-class specifier illegal between operator
keyword and type
Compiler produces an error message pointing online #1. But amazingly, if you
uncomment line #2, compiler happily finishes compilation without a peep.
Gene