Added const variants of Borrow.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-29 19:14:30 +02:00
parent ae73e60f94
commit d46b0d798a
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; }