Why does the compiler not find a match for read1 ? I do not see the difference between read1 and read2 ; Is there a restriction for nested typedef templates like those found in the Foo class?
template<typename T> class Handle{}; class Foo{ public: typedef Handle<Foo> Handle; }; template<typename T> void read1(typename T::Handle){} template<typename T> void read2(Handle<T>){} int main(int argc, char** argv) { Foo::Handle f1; read1(f1); Foo::Handle f2; read2(f2); }
G ++ compiler output, (g ++ 4.4.5)
g++ -c -I. main1.cpp main1.cpp: In function 'int main(int, char**)': main1.cpp:37: error: no matching function for call to 'read1(Handle<Foo>&)'
source share