Skip to content
Joel Falcou edited this page Jun 24, 2015 · 2 revisions

Synopsis

template <typename L>
struct as_tuple;

Description

Transforms a sequence into an std::tuple.

When to use

Brigand collection can only hold types, to be able to work with values, you need to build object such as tuples.

Header

#include <brigand/adapted/as_tuple.hpp>

Parameters

  • L - A sequence of any length

Example

#include <utility>

#include <brigand/adapted/as_tuple.hpp>
#include <brigand/sequences/list.hpp>

using the_list = brigand::list<int, char, bool>;
using the_tuple = brigand::as_tuple<the_list>;

// equivalent of writing std::tuple<int, char, bool>
the_tuple t;

See also

as_pair, as_variant, list

Clone this wiki locally