This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

compilation error with named operator


Hi folks,

this code compiles fine with VC and Comeau Online, but fail with GCC in every version 4.x on Windows and linux.
Can anyone explain why.

error message from GCC: 'struct FOO' has no member named 'operator FOO2<T>::type'

struct FOO
{
ÂÂÂ operator int() constÂÂÂÂÂÂÂÂÂÂÂ { return static_cast< int >(7); }
ÂÂÂ operator double() constÂÂÂÂÂÂÂÂ { return static_cast< double >(7); }
};

template < typename T >
struct FOO2
{
ÂÂÂ typedef TÂÂÂÂÂÂ type;
ÂÂÂ operator type() constÂÂÂÂÂÂÂÂÂÂ { return t->operator type(); }
private:
ÂÂÂ FOO* t;
};

int main()
{
ÂÂÂ FOO2< int > foo2; foo2.operator int();
ÂÂÂ return 1;
}


Kai

___________________________________________________________
Schon gehÃrt? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]