ezconfig
Create C++ Objects from Yaml and Json
Loading...
Searching...
No Matches
ezconfig::variant_hana_maps< T > Struct Template Reference

Type trait for std::variant<> yaml decoding. More...

#include <hana_fwd.hpp>

Detailed Description

template<typename T>
struct ezconfig::variant_hana_maps< T >

Type trait for std::variant<> yaml decoding.

Specializations should define a member "value" that maps yaml tags to type instantiations.

Example:

#include <boost/hana/tuple.hpp>
using MyVariant = std::variant<double, string, int>;
// Specialize type trait for MyVariant type
template<>
struct ezconfig::variant_hana_maps<MyVariant>
{
static constexpr auto value = boost::hana::make_tuple(
boost::hana::make_pair("!double", boost::hana::type_c<double>),
boost::hana::make_pair("!int", boost::hana::type_c<int>),
boost::hana::make_pair("!string", boost::hana::type_c<std::string>));
};
Type trait for std::variant<> yaml decoding.
Definition hana_fwd.hpp:36

Definition at line 35 of file hana_fwd.hpp.


The documentation for this struct was generated from the following file: