Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <utility>
- template<class T>
- struct Array
- {
- Array(Array && other) {
- swap(other);
- }
- Array& operator=(Array&& other) {
- swap(other);
- return *this;
- }
- private:
- size_t size_ = 0;
- T * data_ = nullptr;
- size_t capacity_ = 0;
- void swap(Array& other) {
- std::swap(size_, other.size_);
- std::swap(data_, other.data_);
- std::swap(capacity_, other.capacity_)
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement