Why doesn't the compiler find a match for read1
? I don't see the difference between read1
and read2
; is there a limitation for nested typedef templates like the one 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>&)’