template <class U>

class PinnedUniquePtr

Defined at line 139 of file ../../third_party/cobalt/src/lib/util/not_null.h

PinnedUniquePtr is a wrapper around std::unique_ptr

<T

> that guarantees that the held pointer is

never null.

It does this by:

1) Only being constructible by a move-constructor from NotNullUniquePtr

2) Being immovable (since a move can invalidate the source ptr)

PinnedUniquePtr is the actually usable part of the pair of classes in this file, allowing get,

operator->, operator*, as well as swap() access. No other methods of the underlying unique_ptr

are allowed, as they may cause the held pointer to become null.

Public Methods

template <class U>
void swap (PinnedUniquePtr<U> & other)

Swaps the managed objects and associated deleters of *this and another PinnedUniquePtr object

*other*.

Defined at line 144 of file ../../third_party/cobalt/src/lib/util/not_null.h

template <class U>
void swap (NotNullUniquePtr<U> & other)

Swaps the managed objects and associated deleters of *this and a NotNullUniquePtr object.

Defined at line 150 of file ../../third_party/cobalt/src/lib/util/not_null.h

template <class U>
void swap (NotNullUniquePtr<U> && other)

Swaps the managed objects and associated deleters of *this and a NotNullUniquePtr object (by

rvalue).

Defined at line 157 of file ../../third_party/cobalt/src/lib/util/not_null.h

template <typename U>
void PinnedUniquePtr<T> (NotNullUniquePtr<U> && other)

Construct the PinnedUniquePtr from an existing NotNullUniquePtr. This invalidates the source

ptr, and pins the managed object in place.

Defined at line 164 of file ../../third_party/cobalt/src/lib/util/not_null.h

template <typename U>
PinnedUniquePtr<T> & operator= (NotNullUniquePtr<U> && other)

Defined at line 182 of file ../../third_party/cobalt/src/lib/util/not_null.h

template <typename U>
PinnedUniquePtr<T> & operator= (NotNullUniquePtr<U> & other)

Defined at line 188 of file ../../third_party/cobalt/src/lib/util/not_null.h

T * get ()

Access the contained ptr. Guaranteed never to return null.

Defined at line 194 of file ../../third_party/cobalt/src/lib/util/not_null.h

T * operator-> ()

Defined at line 195 of file ../../third_party/cobalt/src/lib/util/not_null.h

T & operator* ()

Defined at line 196 of file ../../third_party/cobalt/src/lib/util/not_null.h