template <typename T, size_t min_align = 1>

class ExplicitlyConstructed

Defined at line 38 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h

Wraps a variable whose constructor and destructor are explicitly

called. It is particularly useful for a global variable, without its

constructor and destructor run on start and end of the program lifetime.

This circumvents the initial construction order fiasco, while keeping

the address of the empty string a compile time constant.

Pay special attention to the initialization state of the object.

1. The object is "uninitialized" to begin with.

2. Call Construct() or DefaultConstruct() only if the object is

uninitialized. After the call, the object becomes "initialized".

3. Call get() and get_mutable() only if the object is initialized.

4. Call Destruct() only if the object is initialized.

After the call, the object becomes uninitialized.

Public Methods

void DefaultConstruct ()

Defined at line 40 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h

template <typename... Args>
void Construct (Args &&... args)

Defined at line 43 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h

void Destruct ()

Defined at line 47 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h

const T & get ()

Defined at line 49 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h

T * get_mutable ()

Defined at line 50 of file ../../third_party/protobuf/src/google/protobuf/explicitly_constructed.h