Kagome
Polkadot Runtime Engine in C++17
|
#include <variant_builder.hpp>
Public Member Functions | |
VariantBuilder (Variant &v) | |
void | init (size_t index) |
Private Attributes | |
Variant & | v_ |
std::vector< std::function< void(Variant &)> > | funcs_ |
Constructs a value inside boost::variant by type index from variant's definition at runtime.
Allows operating with variants as easy as converting an int to enum value but with more complex types than in enums.
No need to explicitly specify types below, compiler infers them from constructor
Variant | type defenition of boost::variant |
Types | types held inside Variant |
Definition at line 75 of file variant_builder.hpp.
|
inlineexplicit |
v | boost::variant variable to initialize |
Definition at line 81 of file variant_builder.hpp.
|
inline |
Initializes the referenced variant with default constructed instance of object of type at
index | within |
Variant::types |
index | index of type |
Definition at line 93 of file variant_builder.hpp.
|
private |
Definition at line 77 of file variant_builder.hpp.
|
private |
Definition at line 76 of file variant_builder.hpp.