Created
December 2, 2012 18:24
-
-
Save adurpas/4190320 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 #1. | |
| #include "SmartString.hpp" | |
| SmartString::SmartString(std::string* str) : str_(str) {} | |
| SmartString::~SmartString() // Delete string | |
| { | |
| delete str_; | |
| cout << "Destructor: string deleted!"; | |
| } | |
| std::string* SmartString::get() | |
| { | |
| return str_; | |
| } | |
| string* SmartString::operator->() | |
| { | |
| return str_; | |
| } | |
| string& SmartString::operator*() | |
| { | |
| return *str_; | |
| } | |
| SmartString::SmartString(const SmartString& other) // Copy constructor | |
| { | |
| // Nothing to do | |
| } | |
| void SmartString::operator=(const SmartString& other) //Assignment operator | |
| { | |
| // Nothing to do | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment