Im wonderin what do those operators do? My book is lazy and wont tell me.
Im wonderin what do those operators do? My book is lazy and wont tell me.
I AM WINNER!!!1!111oneoneomne
Actually, they are.Originally posted by vVv
Probably because there is no such operator in C++.
They actually do consider .* and ->* single operators.
All they do are derefernce and "attach" a member function pointer to an object directly or through a pointer to an object (respectively). I personally always just think of .* as 2 operators: the . operator and the * operator (same for ->*), but they actually are single operators of their own.
Example usage:
Code:#include<iostream> class An { public: void SomeFunction() const; }; void An::SomeFunction() const { std::cout << "SomeFunction\n"; } int main() { void (An::*MemFunc)() const = An::SomeFunction; An Object, *ObjectPointer = &Object; (Object.*MemFunc)(); (ObjectPointer->*MemFunc)(); return 0; }
Last edited by Polymorphic OOP; 01-05-2003 at 03:49 AM.
Ha, yeah -- it's so much easier to just say "them."Originally posted by vVv
OK, ISO/IEC 14882-1998 agrees with ``them''.
Yeah thanx Polymorphic dude
I AM WINNER!!!1!111oneoneomne