Google Cloud C++ Client
0.4.0
C++ Client Library for Google Cloud Platform
|
A poor's man version of std::optional<T>. More...
#include <google/cloud/optional.h>
Public Member Functions | |
optional () | |
optional (T const &x) | |
optional (T &&x) noexcept | |
optional (optional< T > &&rhs) noexcept | |
optional (optional< T > const &rhs) | |
~optional () | |
optional & | operator= (optional< T > const &rhs) |
optional & | operator= (optional< T > &&rhs) noexcept |
template<typename U = T> | |
std::enable_if< not std::is_same< optional, typename std::decay< U >::type >::value, optional >::type & | operator= (U &&rhs) |
constexpr T const * | operator-> () const |
T * | operator-> () |
constexpr T const & | operator* () const & |
T & | operator* () & |
T && | operator* () && |
T & | value () & |
T const & | value () const & |
T && | value () && |
T const && | value () const && |
template<typename U > | |
constexpr T | value_or (U &&default_value) const & |
template<typename U > | |
T | value_or (U &&default_value) && |
operator bool () const | |
bool | has_value () const |
void | reset () |
T & | emplace (T &&value) |
bool | operator== (optional const &rhs) const |
bool | operator!= (optional const &rhs) const |
bool | operator< (optional const &rhs) const |
bool | operator> (optional const &rhs) const |
bool | operator>= (optional const &rhs) const |
bool | operator<= (optional const &rhs) const |
A poor's man version of std::optional<T>.
This project needs to support C++11 and C++14, so std::optional<> is not available. We cannot use Abseil either, see #232 for the reasons. So we implement a very minimal "optional" class that documents the intent and we will remove it when possible.
T | the type of the optional value. |
constexpr
qualifier. The spec requires them to be constexpr
functions, but the spec assumes C++14 (or newer) semantics for non-const constexpr member functions, and we often compile with C++11 semantics.TODO(#687) - replace with absl::optional<> or std::optional<> when possible.
Definition at line 53 of file optional.h.
|
inline |
Definition at line 55 of file optional.h.
|
inlineexplicit |
Definition at line 56 of file optional.h.
|
inlineexplicitnoexcept |
Definition at line 59 of file optional.h.
|
inlinenoexcept |
Definition at line 62 of file optional.h.
|
inline |
Definition at line 67 of file optional.h.
|
inline |
Definition at line 72 of file optional.h.
|
inline |
Definition at line 194 of file optional.h.
|
inline |
Definition at line 186 of file optional.h.
|
inline |
Definition at line 185 of file optional.h.
|
inline |
Definition at line 211 of file optional.h.
|
inline |
Definition at line 141 of file optional.h.
|
inline |
Definition at line 144 of file optional.h.
|
inline |
Definition at line 151 of file optional.h.
|
inline |
Definition at line 137 of file optional.h.
|
inline |
Definition at line 140 of file optional.h.
|
inline |
Definition at line 215 of file optional.h.
|
inline |
Definition at line 237 of file optional.h.
|
inline |
Definition at line 74 of file optional.h.
|
inlinenoexcept |
Definition at line 95 of file optional.h.
|
inline |
Definition at line 123 of file optional.h.
|
inline |
Definition at line 201 of file optional.h.
|
inline |
Definition at line 229 of file optional.h.
|
inline |
Definition at line 233 of file optional.h.
|
inline |
Definition at line 188 of file optional.h.
|
inline |
Definition at line 155 of file optional.h.
|
inline |
Definition at line 159 of file optional.h.
|
inline |
Definition at line 163 of file optional.h.
|
inline |
Definition at line 168 of file optional.h.
|
inline |
Definition at line 174 of file optional.h.
|
inline |
Definition at line 180 of file optional.h.