Skip to content

Commit

Permalink
fix(ptr): unused value in uniqueptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliot MCNAB authored and Eliot MCNAB committed Dec 4, 2023
1 parent eba4fff commit eac2064
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,36 @@ namespace mini {
template<typename T>
uniqueptr<T>& uniqueptr<T>::operator=(T& other) {
~uniqueptr();
_ptr = other;
this->_ptr = other;
}

template<typename T>
uniqueptr<T>::~uniqueptr(void) {
delete _ptr;
delete (this->_ptr);
}

// =============================[ ACCESSORS ]============================ //

template<typename T>
T* uniqueptr<T>::getPtr(void) const {
return (_ptr);
return (this->_ptr);
}

// =============================[ OPERATORS ]============================ //

template<typename T>
T& uniqueptr<T>::operator*(void) {
return (*_ptr);
return (*this->_ptr);
}

template<typename T>
T* uniqueptr<T>::operator->(void) {
return (_ptr);
return (this->_ptr);
}

template<typename T>
uniqueptr<T>::operator T*(void) const {
return (_ptr);
return (this->_ptr);
}

template<typename T>
Expand Down

0 comments on commit eac2064

Please sign in to comment.