template<typename T>
class tpie::maybe< T >
Definition at line 34 of file maybe.h.
Construct a new unconstructed maybe object.
Definition at line 39 of file maybe.h.
39 : m_constructed(
false) {
If o is constructed throw an exception otherwise do nothing.
Definition at line 45 of file maybe.h.
45 : m_constructed(
false) {
46 o.assert_not_constructed();
Calls the destruct method and destroys the instance.
Definition at line 147 of file maybe.h.
void destruct()
Invokes the deconstructor on the object contained.
template<typename T>
template<typename... T_ARGS>
Contains an element of the type given as template parameter and disallows copy constructing of the maybe class when the object is allocated.
The implementation of maybe either uses variadic templates (if supported by the compiler) or a bunch of overloads to support a variable number of constructor parameters.
- Template Parameters
-
Args | The variadic number of types of constructor parameters. |
- Parameters
-
args | The variadic number of arguments to pass to the constructor of |
Definition at line 98 of file maybe.h.
99 assert_not_constructed();
101 new(&object) T(std::forward<T_ARGS>(t)...);
102 m_constructed =
true;
- Returns
- Whether the object contained is constructed or not.
Definition at line 80 of file maybe.h.
- Returns
- A reference to the object contained.
Definition at line 108 of file maybe.h.
- Returns
- A const reference to the object contained.
Definition at line 115 of file maybe.h.
- Returns
- A pointer to the object contained.
Definition at line 122 of file maybe.h.
- Returns
- A const pointer to the object contained.
Definition at line 129 of file maybe.h.
If o is constructed throw an exception otherwise return *this.
Definition at line 63 of file maybe.h.
64 o.assert_not_constructed();
65 assert_not_constructed();
The documentation for this class was generated from the following file: