template <class T>
class NotNullUniquePtr
Defined at line 27 of file ../../third_party/cobalt/src/lib/util/not_null.h
NotNullUniquePtr is a wrapper around std::unique_ptr
<T
> that guarantees that the contained type
is non-null at construction time.
It does this by:
1) Only being constructible by using MakeNotNullUniquePtr or WrapNotNullUniquePtrOrDefault
which both guarantee that the contained type cannot be null.
2) Not allowing any access to the contained type.
NotNullUniquePtr is a type that is only used in *transit*. It works as a return type to
functions, and it can be transparently converted into a PinnedUniquePtr (see below).
Public Methods
template <typename U>
void NotNullUniquePtr<T> (NotNullUniquePtr<U> && other)
Move constructor. Source NotNullUniquePtr will be invalidated.
Defined at line 75 of file ../../third_party/cobalt/src/lib/util/not_null.h
std::unique_ptr<T> Unwrap ()
Unwrap removes the inner unique_ptr from the NotNullUniquePtr. The NotNullUniquePtr is no
longer valid after this call and must not be used again.
Defined at line 80 of file ../../third_party/cobalt/src/lib/util/not_null.h
Friends
template <class U>
class NotNullSharedPtr
template <class U>
class NotNullUniquePtr
template <class U>
class PinnedUniquePtr
template <typename U>
lib::statusor::StatusOr<NotNullUniquePtr<U>> NotNullUniquePtr (std::unique_ptr<U> && other)
template <typename U>
NotNullUniquePtr<U> NotNullUniquePtr (U * other)
template <typename U, typename V, class... Args>
NotNullUniquePtr<V> NotNullUniquePtr (std::unique_ptr<V> && other, Args &&... args)
template <typename Uclass... Args>
NotNullUniquePtr<U> NotNullUniquePtr (Args &&... args)