perm@mizar.docs.uu.se (Per Mildner) (06/01/89)
I wan't an object to be treated as a pointer by operator->. Below is an outline of what i'm trying to do. I've tried several variants in the places marked '??' but they don't seem to work. I understand that operator-> has some new meaning attached to it recently but haven't seen it explained. The messages produced by g++ (1.35.0 & 1.35.1-) give little indication as to what goes on, eg. 'inline declaration ignored for function taking (...)' or some such. class Object { public: int a; }; class Pointer { int data; public: Object* p; ?? operator ->(); }; inline ?? operator ->() { return ?? p; }; int main (int argc, char* argv[]) { Object O; Pointer P; P.p = &O; P->a = 10; return P->a; }; // I'm Per-Mildner@AIDA.CSD.UU.SE // I wonder if I sen't this to the rigth place.