template <typename T>

class Ptr

Defined at line 1061 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

A smart pointer type for holding objects that are statically known to be

owned by an `Arena`. Even though it is a smart pointer, `Ptr` does not

actually own the underlying object.

`Ptr` exists to provide invariants in the type-system in a way that `T*`

cannot. `Ptr

<T

>` is similar to `T*` except it hoolds extra static

information (the fact that it is arena owned) and extra dynamic information

(the arena that owns it). Main differences from `UniquePtr` are:

- `Ptr` is never null. It has no default state, and no moved-from state.

- `Ptr` does not own the object. The underlying `Arena` does.

- `Ptr` is copyable. Trying to move it will just copy it, just like `T*`

would.

- `Ptr` has no `reset()`. It can be assigned from another `Ptr`.

Public Methods

void Ptr<T> (const Ptr<T> & rhs)

Defined at line 1067 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

template <typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>>
void Ptr<T> (const Ptr<U> & rhs)

NOLINTNEXTLINE(google-explicit-constructor)

Defined at line 1071 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

void ~Ptr<T> ()

Defined at line 1073 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

Ptr<T> & operator= (const Ptr<T> & rhs)

Defined at line 1075 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

template <typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>>
Ptr<T> & operator= (const Ptr<U> & rhs)

Defined at line 1078 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

void swap (Ptr<T> & other)

Defined at line 1084 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

pointer get ()

Defined at line 1090 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

pointer operator-> ()

Defined at line 1091 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

element_type & operator* ()

Defined at line 1092 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

Arena * GetOwningArena ()

Return a pointer to the Arena pointer that owns the pointed to message.

Defined at line 1095 of file ../../third_party/protobuf/src/src/google/protobuf/arena.h

Friends

template <typename U>
class Ptr
template <typename T>
class Arena
template <typename H>
H Ptr (H h, Ptr<T> u)
template <typename Sink>
void Ptr (Sink & sink, Ptr<T> ptr)
template <typename T>
void Ptr (Ptr<T> & aPtr<T> & b)