Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
make_cons
Description

Create a cons from car (head) and optional cdr (tail).

Synopsis
template <typename Car>
typename result_of::make_cons<Car>::type
make_cons(Car const& car);

template <typename Car, typename Cdr>
typename result_of::make_cons<Car, Cdr>::type
make_cons(Car const& car, Cdr const& cdr);
Parameters

Parameter

Requirement

Description

car

Instance of Car

The list's head

cdr

Instance of Cdr

The list's tail (optional)

Expression Semantics
make_cons(car, cdr);

Return type: result_of::make_cons<Car, Cdr>::type or result_of::make_cons<Car>::type

Semantics: Create a cons from car (head) and optional cdr (tail).

Header
#include <boost/fusion/container/generation/make_cons.hpp>
#include <boost/fusion/include/make_cons.hpp>
Example
make_cons('x', make_cons(123))
See also

Reference Wrappers


PrevUpHomeNext