------- Comment #2 from lfn dot privat at mail dot dk 2009-04-02 15:54 ------- (In reply to comment #1) > This is correct behavior as MyType is not in the namespace so Read is not > found > after the call. If you want Read to be found, you can put it in the same > namespace as MyType.
I'm not sure this answer is meaningful. Consider the following (real life usage) angle on the below example: The first two ReadSpace::Read() overload functions are provided by a library. The first one supports reading an int (common use) and the other supports reading a vector<> of any type (also very usable): static inline bool Read( const char* Str, int& v ); template< class T > static inline bool Read( const char* Str, std::vector< T >& v ); Now, from some third party library we get MyType (in global namespace - out of our control) and we need to introduce a ReadSpace::Read() overload function for it. That is, as shown in the example, done by ... static inline bool Read( const char* Str, MyType& v ) Now the compiler should be in perfect shape to read (Read()) MyType as well as vector< MyType > as also all previous versions of gcc have no problems with. Also Microsoft C++ compilers of the last 10 years have no problem resolving this. If you think otherwise, I really need a better explanation. Thanks in advance. -- lfn dot privat at mail dot dk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36982