Possible Duplicate:
C++ difference of keywords 'typename' and 'class' in templates
I already know in many cases that class
cannot be replaced by typename
. I am only talking about the opposite: replacing typename
by class
.
Someone pointed out that only typename
can be used here:
template<class param_t> class Foo
{
typedef typename param_t::baz sub_t;
};
But I do not see any problem replacing typename
with class
here (in MSVC).
To recap, can I ALWAYS replace typename with class? Please give an example if not.