retu7rn this c 2b 2b

Solutions on MaxInterview for retu7rn this c 2b 2b by the best coders in the world

showing results for - "retu7rn this c 2b 2b"
Emmanuel
10 Jun 2018
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};