@@ -29,31 +29,31 @@ class Box {
2929 // / The only way of creating new boxes is
3030 // / Box<T>::make(...).
3131 template <class ... Args>
32- static Box<T, C> make (Args&&... _args) {
33- return Box<T, C> (std::make_unique<T>(std::forward<Args>(_args)...));
32+ static Box make (Args&&... _args) {
33+ return Box (std::make_unique<T>(std::forward<Args>(_args)...));
3434 }
3535
3636 // / You can generate them from unique_ptrs as well, in which case it will
3737 // / return an Error, if the unique_ptr is not set.
38- static Result<Box<T, C> > make (std::unique_ptr<T>&& _ptr) {
38+ static Result<Box> make (std::unique_ptr<T>&& _ptr) {
3939 if (!_ptr) {
4040 return error (" std::unique_ptr was a nullptr." );
4141 }
42- return Box<T, C> (std::move (_ptr));
42+ return Box (std::move (_ptr));
4343 }
4444
4545 Box () : ptr_(std::make_unique<T>()) {}
4646
4747 // / Copy constructor if copyable
48- Box (const Box<T, C> & _other) requires (C == Copyability::COPYABLE)
48+ Box (const Box& _other) requires (C == Copyability::COPYABLE)
4949 {
5050 ptr_ = std::make_unique<T>(*_other);
5151 }
5252
5353 // / Copy constructor if not copyable
54- Box (const Box<T, C> & _other) requires (C == Copyability::NON_COPYABLE) = delete ;
54+ Box (const Box& _other) requires (C == Copyability::NON_COPYABLE) = delete ;
5555
56- Box (Box<T, C> && _other) = default ;
56+ Box (Box&& _other) = default ;
5757
5858 template <class U , Copyability C2>
5959 Box (Box<U, C2>&& _other) noexcept
@@ -65,22 +65,22 @@ class Box {
6565 T* get () const { return ptr_.get (); }
6666
6767 // / Copy assignment operator if copyable
68- Box<T, C> & operator =(const Box<T>& other) requires (C == Copyability::COPYABLE) {
68+ Box& operator =(const Box<T>& other) requires (C == Copyability::COPYABLE) {
6969 if (this != &other) {
7070 ptr_ = std::make_unique<T>(*other);
7171 }
7272 return *this ;
7373 }
7474
7575 // / Copy assignment operator if not copyable
76- Box<T, C> & operator =(const Box<T> & _other) requires (C == Copyability::NON_COPYABLE) = delete ;
76+ Box& operator =(const Box& _other) requires (C == Copyability::NON_COPYABLE) = delete ;
7777
7878 // / Move assignment operator
79- Box<T, C> & operator =(Box<T, C> && _other) noexcept = default ;
79+ Box& operator =(Box&& _other) noexcept = default ;
8080
8181 // / Move assignment operator
8282 template <class U >
83- Box<T, C> & operator =(Box<U>&& _other) noexcept {
83+ Box& operator =(Box<U>&& _other) noexcept {
8484 ptr_ = std::forward<std::unique_ptr<U>>(_other.ptr ());
8585 return *this ;
8686 }
0 commit comments