What is the difference between the two methods?
Sometimes when I get compile-time errors complaining that the compiler does not recognize some class types in functi
Using keyword class, struct, enum in a type parameter declaration is called elaborated type specifier. It introduces the new type in the scope where the function is declared. It is similar to forward declaration.
There is also another using of such a declaration. For example if a name of an object or a function name hides a class or enum with the same name. For example
struct A {};
A A; // now A is seen as an identifier of the object
void f( struct A );