Related Functions | List of all members
optional Class Reference

This class is a replacement for C++17 std::optional. More...

#include <cvb/shims/optional.hpp>

Related Functions

(Note that these are not member functions.)

template<class T >
optional< typename std::decay< T >::type > make_optional (T &&value)
 Factory function to create an optional from a T object. More...
 
template<class T , class... ARGS>
optional< T > make_optional (ARGS &&... args)
 Factory function to in-place construct a T in an optional. More...
 

Detailed Description

This class is a replacement for C++17 std::optional.

Friends And Related Function Documentation

◆ make_optional() [1/2]

optional< typename std::decay< T >::type > make_optional ( T &&  value)
related

Factory function to create an optional from a T object.

Template Parameters
TType of value to store.
Parameters
[in]valueValue to be forwarded to the optional.
Returns
optional with the set value.

◆ make_optional() [2/2]

optional< T > make_optional ( ARGS &&...  args)
related

Factory function to in-place construct a T in an optional.

Template Parameters
TType of value to store.
ARGSType list of all arguments to be forwarded to T.
Parameters
[in]argsArguments to be forwarded to the ctor of T.
Returns
optional with newly constructed T.