| 52 | |
| 53 | // cCharProxy -- To detect rvalue vs lvalue --------------------- |
| 54 | class cCharProxy |
| 55 | { |
| 56 | private: |
| 57 | cString& string; |
| 58 | int index; |
| 59 | |
| 60 | public: |
| 61 | cCharProxy(cString& _string, int _index) : string(_string), index(_index) { ; } |
| 62 | |
| 63 | inline cCharProxy& operator=(char c); // lvalue |
| 64 | inline cCharProxy& operator+=(char c); // lvalue |
| 65 | inline cCharProxy& operator-=(char c); // lvalue |
| 66 | inline cCharProxy& operator++(); // lvalue (prefix) |
| 67 | inline char operator++(int dummy); // lvalue (postfix) |
| 68 | inline cCharProxy& operator--(); // lvalue (prefix) |
| 69 | inline char operator--(int dummy); // lvalue (postfix) |
| 70 | inline operator char () const; // rvalue |
| 71 | }; |
| 72 | friend class cCharProxy; // Telling rvalue vs lvalue .... |
| 73 | |
| 74 | // cStringData -- Holds the actual data and is reference count -- |