Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <string.h>
- #include <iostream>
- class Stuff
- {
- public:
- Stuff(std::string* str_ = 0) : str_ (str_){}
- ~Stuff(){delete[] str_;}
- std::string* get(){return str_;}
- std::string* operator->(){ return str_;}
- std::string& operator*() { return *str_;}
- Stuff(const SmartString& other)
- {
- std::copy(other.str_, other.str_+ counter_, str_);
- }
- Stuff& operator=(const Stuff& other)
- {
- swap(*this, other);
- return *this;
- }
- private:
- std::string* str_;
- unsigned int* counter_;
- };
Add Comment
Please, Sign In to add comment