Struct optional_storage_policy_for

Synopsis

#include <include/type_safe/optional.hpp>

template <typename T>
struct optional_storage_policy_for

Description

Selects the storage policy used when rebinding a [ts::basic_optional]().

Some operations like [ts::basic_optional::map()]() change the type of an optional. This traits controls which StoragePolicy is going to be used for the new optional. You can for example requests a [ts::compact_optional_storage]() for your type, simply specialize it and set a type typedef. \module optional

Source

Lines 108-112 in include/type_safe/optional.hpp.

template <typename T>
struct optional_storage_policy_for
{
    using type = void;
};





Add Discussion as Guest

Log in