I'm trying to compile the following code with gcc (version below). I
would expect the compile to try the operator ==() declared in
Tangram::Backen d because of Koenig lookup. But it doesn't happen. Is
it me or the compiler?
namespace Tangram {
namespace Backend {
struct RELATIONAL;
template<typena me B>
struct Expression_Hand le {
Expression_Hand le();
Expression_Hand le(int);
};
template<typena me B>
struct Predicate_Handl e {
};
template<typena me B>
Predicate_Handl e<B> operator ==(const Expression_Hand le<B>&, const Expression_Hand le<B>&);
}
namespace Relational {
using Backend::RELATI ONAL;
typedef Backend::Expres sion_Handle<REL ATIONAL> Expression;
}
}
void foo() {
using namespace Tangram::Relati onal;
Expression expr;
expr == Expression(666) ; // ok
expr == 666; // error: no match for 'operator==' in 'expr == 666'
}
Here's my gcc:
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=releas e --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++ ,objc,java,f95, ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)
--
Jean-Louis Leroy
Sound Object Logic
http://www.soundobjectlogic.com