Missing implicitly declared member functions
Klaus-Georg Adams
Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Wed Nov 11 02:53:00 GMT 1998
Valentin Bonnard writes:
> struct T
> {
> // T* operator& () { return this; }
> };
>
> int main ()
> {
> T* (T::*a) () = &T::operator&; // ERROR
> const T* (T::*b) () const = &T::operator&; // ERROR
> T& (T::*c) (const T&) = &T::operator=; // OK
> T x;
> if (0)
> x.~T (); // OK
> }
>
> Both & are missing.
Hi Valentin,
how did you get the idea that operator&() should be implicitely
declared and defined? In the ISO/IEC document, chapter [special] it is
not mentioned. The special member functions mentioned are
- The default constructor [class.ctor]
- The copy constructor and opy assignment operator [class.copy]
- The destructor [class.dtor]
-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------
More information about the Gcc-bugs
mailing list