typedef int abc;
class Some{
public:
abc foo(){...}
typedef double abc;
};
In the code above, I get it that I get an error:
error: changes meaning of 'abc' from 'typedef int abc'
because in the book c++ primer,fifth edtion, it says:
Class definitions are processed in two phases:
1.First, the member declarations are compiled.
2.Function bodies are compiled only after the entire class has been seen.
But in the code here:
typedef int abc;
class Some{
public:
int foo(abc){...}
typedef double abc;
};
I set abc
in the parameter list.
But I didn't get that kind of error and the compiler works perfectly fine.
why the latter code won't get me any error similar to the former?