Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename U>
- struct Target__
- {
- protected:
- U *entries_ = nullptr;
- int size_;
- public:
- Target__<U> operator=(Target__<U> &other) {
- size_ = other.size_;
- if (size_ > 0) {
- entries_ = std::copy(other.entries_, other.entries_ + size_, new U[size_]);
- return *this;
- } else {
- throw (std::out_of_range("Size of Target cannot be Zero"));
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement