again compilation error with named operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please excuse the unnecessary character in the first request. I hope it's readable now

-----------------------------------------------------------------------------------------

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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux