Created
December 2, 2012 18:29
-
-
Save adurpas/4190336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #9, exercise #2. | |
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| class SmartString | |
| { | |
| friend ostream& operator<<(ostream& os, const SmartString& ss); | |
| public: | |
| SmartString(string* str); | |
| ~SmartString(); | |
| string* get(); | |
| string* operator->(); | |
| string& operator*(); | |
| SmartString(const SmartString& other); | |
| SmartString& operator=(const SmartString& other); | |
| private: | |
| string* str_; | |
| unsigned int* counter_; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment