-
Notifications
You must be signed in to change notification settings - Fork 48
as_variant
Joel Falcou edited this page Jun 24, 2015
·
1 revision
template <typename L>
struct as_variant;
Transforms a sequence into a boost::variant
.
Brigand collection can only hold types, to be able to work with values, you need to build object such as variant.
#include <brigand/adapted/as_variant.hpp>
- L - A sequence of any length
#include <utility>
#include <brigand/adapted/as_variant.hpp>
#include <brigand/sequences/list.hpp>
using the_list = brigand::list<int, char, bool>;
using the_variant = brigand::as_variant<the_list>;
// equivalent of writing boost::variant<int, char, bool>
the_variant t;