Hi,
Consider the code below.
typedef double T;
class A{
public:
typedef int T;
T fn(T t);
};
T A::fn(T t){
return T();
}
int main(){
A a;
a.fn(0);
}
This program is ill-formed, because the return type of the function
declaration A::fn is int, but when it is defined outside of the class
declaration, the type of return type is double.
However I am not clear on which section of the C++ standard talks
about this behaviour. Please guide me.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]