Added const variants of Borrow.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-03-29 19:14:30 +02:00
parent ae73e60f94
commit d46b0d798a
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,10 @@ namespace Arbutils::Memory {
inline NonNullBorrowedPtr<T> Borrow() { return NonNullBorrowedPtr<T>(_ptr); }
inline const NonNullBorrowedPtr<const T> Borrow() const{
return NonNullBorrowedPtr<const T>(_ptr);
}
T* operator->() noexcept { return _ptr; }
const T* operator->() const noexcept { return _ptr; }

View File

@ -24,6 +24,9 @@ namespace Arbutils::Memory {
inline BorrowedPtr<T> Borrow(){
return BorrowedPtr<T>(_ptr);
}
inline const BorrowedPtr<const T> Borrow() const{
return BorrowedPtr<const T>(_ptr);
}
T* operator->() noexcept { return _ptr; }
const T* operator->() const noexcept { return _ptr; }