This class is a replacement for C++17 std::optional.
More...
#include <cvb/shims/optional.hpp>
|
(Note that these are not member symbols.)
|
template<class T> |
optional< typename std::decay< T >::type > | make_optional (T &&value) |
| Factory function to create an optional from a T object.
|
|
template<class T, class... ARGS> |
optional< T > | make_optional (ARGS &&...args) |
| Factory function to in-place construct a T in an optional.
|
|
This class is a replacement for C++17 std::optional.
◆ make_optional() [1/2]
template<class T, class... ARGS>
optional< T > make_optional |
( |
ARGS &&... | args | ) |
|
|
related |
Factory function to in-place construct a T
in an optional.
- Template Parameters
-
T | Type of value to store. |
ARGS | Type list of all arguments to be forwarded to T . |
- Parameters
-
[in] | args | Arguments to be forwarded to the ctor of T . |
- Returns
- optional with newly constructed
T
.
◆ make_optional() [2/2]
Factory function to create an optional from a T
object.
- Template Parameters
-
- Parameters
-
[in] | value | Value to be forwarded to the optional. |
- Returns
- optional with the set value.