1class myclass {
2public:
3 // Return by pointer needs const and non-const versions
4 myclass* ReturnPointerToCurrentObject() { return this; }
5 const myclass* ReturnPointerToCurrentObject() const { return this; }
6
7 // Return by reference needs const and non-const versions
8 myclass& ReturnReferenceToCurrentObject() { return *this; }
9 const myclass& ReturnReferenceToCurrentObject() const { return *this; }
10
11 // Return by value only needs one version.
12 myclass ReturnCopyOfCurrentObject() const { return *this; }
13};