[/============================================================================== Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ===============================================================================/] [section Container] Fusion provides a few predefined sequences out of the box. These /containers/ actually hold heterogenously typed data; unlike __views__. These containers are more or less counterparts of those in __stl__. [heading Header] #include #include [section vector] [heading Description] `vector` is a __random_access_sequence__ of heterogenous typed data structured as a simple `struct` where each element is held as a member variable. `vector` is the simplest of the Fusion sequence container, and in many cases the most efficient. [heading Header] #include #include #include #include // numbered forms #include #include #include #include #include #include #include #include #include #include [heading Synopsis] [*Numbered forms] struct vector0; template struct vector1; template struct vector2; template struct vector3; ... template struct vectorN; [*Variadic form] template < typename T0 = __unspecified__ , typename T1 = __unspecified__ , typename T2 = __unspecified__ ... , typename TN = __unspecified__ > struct vector; The numbered form accepts the exact number of elements. Example: vector3 The variadic form accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that defaults to `10`. Example: vector You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_VECTOR_SIZE 20 [heading Template parameters] [table [[Parameter] [Description] [Default]] [[`T0`...`TN`] [Element types] [['unspecified]]] ] [heading Model of] * __random_access_sequence__ [variablelist Notation [[`v`] [Instance of `vector`]] [[`V`] [A `vector` type]] [[`e0`...`en`] [Heterogeneous values]] [[`s`] [A __forward_sequence__]] ] [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not defined in __random_access_sequence__. [table [[Expression] [Semantics]] [[`V()`] [Creates a vector with default constructed elements.]] [[`V(e0, e1,... en)`] [Creates a vector with elements `e0`...`en`.]] [[`V(s)`] [Copy constructs a vector from a __forward_sequence__, `s`.]] [[`v = s`] [Assigns to a vector, `v`, from a __forward_sequence__, `s`.]] ] [heading Example] vector v(12, 5.5f); std::cout << __at_c__<0>(v) << std::endl; std::cout << __at_c__<1>(v) << std::endl; [endsect] [section cons] [heading Description] `cons` is a simple __forward_sequence__. It is a lisp style recursive list structure where `car` is the /head/ and `cdr` is the /tail/: usually another cons structure or `nil`: the empty list. Fusion's __list__ is built on top of this more primitive data structure. It is more efficient than __vector__ when the target sequence is constructed piecemeal (a data at a time). The runtime cost of access to each element is peculiarly constant (see __recursive_inline__). [heading Header] #include #include [heading Synopsis] template struct cons; [heading Template parameters] [table [[Parameter] [Description] [Default]] [[`Car`] [Head type] []] [[`Cdr`] [Tail type] [`nil`]] ] [heading Model of] * __forward_sequence__ [variablelist Notation [[`nil`] [An empty `cons`]] [[`C`] [A `cons` type]] [[`l`, `l2`] [Instances of `cons`]] [[`car`] [An arbitrary data]] [[`cdr`] [Another `cons` list]] [[`s`] [A __forward_sequence__]] [[`N`] [An __mpl_integral_constant__]] ] [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not defined in __forward_sequence__. [table [[Expression] [Semantics]] [[`nil()`] [Creates an empty list.]] [[`C()`] [Creates a cons with default constructed elements.]] [[`C(car)`] [Creates a cons with `car` head and default constructed tail.]] [[`C(car, cdr)`] [Creates a cons with `car` head and `cdr` tail.]] [[`C(s)`] [Copy constructs a cons from a __forward_sequence__, `s`.]] [[`l = s`] [Assigns to a cons, `l`, from a __forward_sequence__, `s`.]] [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] [blurb __note__ `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `cons` being a __forward_sequence__ only (`at` is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is constant (see __recursive_inline__).] [heading Example] cons > l(12, cons(5.5f)); std::cout << __at_c__<0>(l) << std::endl; std::cout << __at_c__<1>(l) << std::endl; [endsect] [section list] [heading Description] `list` is a __forward_sequence__ of heterogenous typed data built on top of __cons__. It is more efficient than __vector__ when the target sequence is constructed piecemeal (a data at a time). The runtime cost of access to each element is peculiarly constant (see __recursive_inline__). [heading Header] #include #include #include #include [heading Synopsis] template < typename T0 = __unspecified__ , typename T1 = __unspecified__ , typename T2 = __unspecified__ ... , typename TN = __unspecified__ > struct list; The variadic class interface accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults to `10`. Example: list You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_LIST_SIZE 20 [heading Template parameters] [table [[Parameter] [Description] [Default]] [[`T0`...`TN`] [Element types] [['unspecified-type]]] ] [heading Model of] * __forward_sequence__ [variablelist Notation [[`L`] [A `list` type]] [[`l`] [An instance of `list`]] [[`e0`...`en`] [Heterogeneous values]] [[`s`] [A __forward_sequence__]] [[`N`] [An __mpl_integral_constant__]] ] [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not defined in __forward_sequence__. [table [[Expression] [Semantics]] [[`L()`] [Creates a list with default constructed elements.]] [[`L(e0, e1,... en)`] [Creates a list with elements `e0`...`en`.]] [[`L(s)`] [Copy constructs a list from a __forward_sequence__, `s`.]] [[`l = s`] [Assigns to a list, `l`, from a __forward_sequence__, `s`.]] [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] [blurb __note__ `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `list` being a __forward_sequence__ only (__at__ is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is constant (see __recursive_inline__).] [heading Example] list l(12, 5.5f); std::cout << __at_c__<0>(l) << std::endl; std::cout << __at_c__<1>(l) << std::endl; [endsect] [section set] [heading Description] set is an __associative_sequence__ of heteregenous typed data elements. Type identity is used to impose an equivalence relation on keys. The element's type is its key. A set may contain at most one element for each key. Membership testing and element key lookup has constant runtime complexity (see __overloaded_functions__). [heading Header] #include #include #include #include [heading Synopsis] template < typename T0 = __unspecified__ , typename T1 = __unspecified__ , typename T2 = __unspecified__ ... , typename TN = __unspecified__ > struct set; The variadic class interface accepts `0` to `FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that defaults to `10`. Example: set You may define the preprocessor constant `FUSION_MAX_SET_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_SET_SIZE 20 [heading Template parameters] [table [[Parameter] [Description] [Default]] [[`T0`...`TN`] [Element types] [['unspecified-type]]] ] [heading Model of] * __associative_sequence__ * __forward_sequence__ [variablelist Notation [[`S`] [A `set` type]] [[`s`] [An instance of `set`]] [[`e0`...`en`] [Heterogeneous values]] [[`fs`] [A __forward_sequence__]] ] [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not defined in __random_access_sequence__ and __associative_sequence__. [table [[Expression] [Semantics]] [[`S()`] [Creates a set with default constructed elements.]] [[`S(e0, e1,... en)`] [Creates a set with elements `e0`...`en`.]] [[`S(fs)`] [Copy constructs a set from a __forward_sequence__ `fs`.]] [[`s = fs`] [Assigns to a set, `s`, from a __forward_sequence__ `fs`.]] ] [heading Example] typedef set S; S s(12, 5.5f); std::cout << __at_key__(s) << std::endl; std::cout << __at_key__(s) << std::endl; std::cout << __result_of_has_key__::value << std::endl; [endsect] [section map] [heading Description] map is an __associative_sequence__ of heteregenous typed data elements. Each element is a key/data pair (see __fusion_pair__) where the key has no data (type only). Type identity is used to impose an equivalence relation on keys. A map may contain at most one element for each key. Membership testing and element key lookup has constant runtime complexity (see __overloaded_functions__). [heading Header] #include #include #include #include [heading Synopsis] template < typename T0 = __unspecified__ , typename T1 = __unspecified__ , typename T2 = __unspecified__ ... , typename TN = __unspecified__ > struct map; The variadic class interface accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`. Example: map<__pair__, __pair__, __pair__ > You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_MAP_SIZE 20 [heading Template parameters] [table [[Parameter] [Description] [Default]] [[`T0`...`TN`] [Element types] [['unspecified-type]]] ] [heading Model of] * __associative_sequence__ * __random_access_sequence__ [variablelist Notation [[`M`] [A `map` type]] [[`m`] [An instance of `map`]] [[`e0`...`en`] [Heterogeneous key/value pairs (see __fusion_pair__)]] [[`s`] [A __forward_sequence__]] ] [heading Expression Semantics] Semantics of an expression is defined only where it differs from, or is not defined in __forward_sequence__ and __associative_sequence__. [table [[Expression] [Semantics]] [[`M()`] [Creates a map with default constructed elements.]] [[`M(e0, e1,... en)`] [Creates a map with element pairs `e0`...`en`.]] [[`M(s)`] [Copy constructs a map from a __forward_sequence__ `s`.]] [[`m = s`] [Assigns to a map, `m`, from a __forward_sequence__ `s`.]] ] [heading Example] typedef map< __pair__ , __pair__ > map_type; map_type m( __fusion_make_pair__('X') , __fusion_make_pair__("Men")); std::cout << __at_key__(m) << std::endl; std::cout << __at_key__(m) << std::endl; [endsect] [section Generation] These are the functions that you can use to generate various forms of __containers__ from elemental values. [heading Header] #include #include [section Functions] [section make_list] [heading Description] Create a __list__ from one or more values. [heading Synopsis] template typename __result_of_make_list__::type make_list(T0 const& x0, T1 const& x1... TN const& xN); The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_LIST_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_list`]] ] [heading Expression Semantics] make_list(x0, x1,... xN); [*Return type]: __result_of_make_list__`::type` [*Semantics]: Create a __list__ from `x0, x1,... xN`. [heading Header] #include #include [heading Example] make_list(123, "hello", 12.5) [heading See also] __note_boost_ref__ [endsect] [section make_cons] [heading Description] Create a __cons__ from `car` (/head/) and optional `cdr` (/tail/). [heading Synopsis] template typename __result_of_make_cons__::type make_cons(Car const& car); template typename __result_of_make_cons__::type make_cons(Car const& car, Cdr const& cdr); [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`car`] [Instance of `Car`] [The list's head]] [[`cdr`] [Instance of `Cdr`] [The list's tail (optional)]] ] [heading Expression Semantics] make_cons(car, cdr); [*Return type]: __result_of_make_cons__`::type` or __result_of_make_cons__`::type` [*Semantics]: Create a __cons__ from `car` (/head/) and optional `cdr` (/tail/). [heading Header] #include #include [heading Example] make_cons('x', make_cons(123)) [heading See also] __note_boost_ref__ [endsect] [section make_vector] [heading Description] Create a __vector__ from one or more values. [heading Synopsis] template typename __result_of_make_vector__::type make_vector(T0 const& x0, T1 const& x1... TN const& xN); The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_VECTOR_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_vector`]] ] [heading Expression Semantics] make_vector(x0, x1,... xN); [*Return type]: __result_of_make_vector__`::type` [*Semantics]: Create a __vector__ from `x0, x1,... xN`. [heading Header] #include #include [heading Example] make_vector(123, "hello", 12.5) [heading See also] __note_boost_ref__ [endsect] [section make_set] [heading Description] Create a __set__ from one or more values. [heading Synopsis] template typename __result_of_make_set__::type make_set(T0 const& x0, T1 const& x1... TN const& xN); The variadic function accepts `0` to `FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_SET_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_SET_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_set`]] ] [heading Expression Semantics] make_set(x0, x1,... xN); [*Return type]: __result_of_make_set__`::type` [*Semantics]: Create a __set__ from `x0, x1,... xN`. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] make_set(123, "hello", 12.5) [heading See also] __note_boost_ref__ [endsect] [section make_map] [heading Description] Create a __map__ from one or more key/data pairs. [heading Synopsis] template < typename K0, typename K1,... typename KN , typename T0, typename T1,... typename TN> typename __result_of_make_map__::type make_map(T0 const& x0, T1 const& x1... TN const& xN); The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_MAP_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`K0, K1,... KN`] [The key types] [Keys associated with `x0, x1,... xN`]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_map`]] ] [heading Expression Semantics] make_map(x0, x1,... xN); [*Return type]: __result_of_make_map__`::type` [*Semantics]: Create a __map__ from `K0, K1,... KN` keys and `x0, x1,... xN` data. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] make_map('X', "Men") [heading See also] __note_boost_ref__, __fusion_pair__ [endsect] [section Tiers] Tiers are sequences, where all elements are non-const reference types. They are constructed with a call to a couple of /tie/ function templates. The succeeding sections document the various /tier/ flavors. * __list_tie__ * __vector_tie__ * __map_tie__ Example: int i; char c; double d; ... __vector_tie__(i, c, a); The __vector_tie__ function creates a __vector__ of type `__vector__`. The same result could be achieved with the call __make_vector__(__boost_ref_call__(i), __boost_ref_call__(c), __boost_ref_call__(a)) [footnote see __boost_ref__ for details about `ref`]. A /tie/ can be used to 'unpack' another tuple into variables. E.g.: int i; char c; double d; __vector_tie__(i, c, d) = __make_vector__(1,'a', 5.5); std::cout << i << " " << c << " " << d; This code prints 1 a 5.5 to the standard output stream. A sequence unpacking operation like this is found for example in ML and Python. It is convenient when calling functions which return sequences. [heading Ignore] There is also an object called /ignore/ which allows you to ignore an element assigned by a sequence. The idea is that a function may return a sequence, only part of which you are interested in. For example: char c; __vector_tie__(ignore, c) = __make_vector__(1, 'a'); [endsect] [section list_tie] [heading Description] Constructs a tie using a __list__ sequence. [heading Synopsis] template __list__ list_tie(T0& x0, T1& x1... TN& xN); The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_LIST_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `list_tie`]] ] [heading Expression Semantics] list_tie(x0, x1,... xN); [*Return type]: __list__ [*Semantics]: Create a __list__ of references from `x0, x1,... xN`. [heading Header] #include #include [heading Example] int i = 123; double d = 123.456; list_tie(i, d) [endsect] [section vector_tie] [heading Description] Constructs a tie using a __vector__ sequence. [heading Synopsis] template __vector__ vector_tie(T0& x0, T1& x1... TN& xN); The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_VECTOR_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `vector_tie`]] ] [heading Expression Semantics] vector_tie(x0, x1,... xN); [*Return type]: __vector__ [*Semantics]: Create a __vector__ of references from `x0, x1,... xN`. [heading Header] #include #include [heading Example] int i = 123; double d = 123.456; vector_tie(i, d) [endsect] [section map_tie] [heading Description] Constructs a tie using a __map__ sequence. [heading Synopsis] template __map__<__pair__, __pair__,... __pair__ > map_tie(D0& d0, D1& d1... DN& dN); The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`, and a corresponding number of key types. You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_MAP_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`K0, K1,... KN`] [Any type][The key types associated with each of the `x1,x2,...,xN` values]] [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `map_tie`]] ] [heading Expression Semantics] map_tie(x0, x1,... xN); [*Return type]: __map__<__pair__, __pair__,... __pair__ > [*Semantics]: Create a __map__ of references from `x0, x1,... xN` with keys `K0, K1,... KN` [heading Header] #include #include [heading Example] struct int_key; struct double_key; ... int i = 123; double d = 123.456; map_tie(i, d) [endsect] [endsect] [section MetaFunctions] [section make_list] [heading Description] Returns the result type of __make_list__. [heading Synopsis] template struct make_list; The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_LIST_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`T0, T1,... TN`] [Any type] [Template arguments to `make_list`]] ] [heading Expression Semantics] result_of::make_list::type [*Return type]: A __list__ with elements of types converted following the rules for __element_conversion__. [*Semantics]: Create a __list__ from `T0, T1,... TN`. [heading Header] #include #include [heading Example] result_of::make_list::type [endsect] [section make_cons] [heading Description] Returns the result type of __make_cons__. [heading Synopsis] template struct make_cons; [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`Car`] [Any type] [The list's head type]] [[`Cdr`] [A `cons`] [The list's tail type (optional)]] ] [heading Expression Semantics] result_of::make_cons::type [*Return type]: A __cons__ with head element, `Car`, of type converted following the rules for __element_conversion__, and tail, `Cdr`. [*Semantics]: Create a __cons__ from `Car` (/head/) and optional `Cdr` (/tail/). [heading Header] #include #include [heading Example] result_of::make_cons::type>::type [endsect] [section make_vector] [heading Description] Returns the result type of __make_vector__. [heading Synopsis] template struct make_vector; The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_VECTOR_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`T0, T1,... TN`] [Any type] [Template arguments to `make_vector`]] ] [heading Expression Semantics] result_of::make_vector::type [*Return type]: A __vector__ with elements of types converted following the rules for __element_conversion__. [*Semantics]: Create a __vector__ from `T0, T1,... TN`. [heading Header] #include #include [heading Example] result_of::make_vector::type [endsect] [section make_set] [heading Description] Returns the result type of __make_set__. [heading Synopsis] template struct make_set; The variadic function accepts `0` to `FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_SET_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_SET_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`T0, T1,... TN`] [Any type] [The arguments to `make_set`]] ] [heading Expression Semantics] result_of::make_set::type [*Return type]: A __set__ with elements of types converted following the rules for __element_conversion__. [*Semantics]: Create a __set__ from `T0, T1,... TN`. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] result_of::make_set::type [endsect] [section make_map] [heading Description] Returns the result type of __make_map__. [heading Synopsis] template < typename K0, typename K1,... typename KN , typename T0, typename T1,... typename TN> struct make_map; The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_MAP_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`K0, K1,... KN`] [Any type] [Keys associated with `T0, T1,... TN`]] [[`T0, T1,... TN`] [Any type] [Data associated with keys `K0, K1,... KN`]] ] [heading Expression Semantics] resulf_of::make_map::type; [*Return type]: __result_of_make_map__`::type` [*Semantics]: A __map__ with __fusion_pair__ elements where the `second_type` is converted following the rules for __element_conversion__. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] result_of::make_map::type [heading See also] __fusion_pair__ [endsect] [section list_tie] [heading Description] Returns the result type of __list_tie__. [heading Synopsis] template struct list_tie; The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_LIST_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`T0, T1,... TN`] [Any type] [The arguments to `list_tie`]] ] [heading Expression Semantics] result_of::list_tie::type; [*Return type]: __list__ [*Semantics]: Create a __list__ of references from `T0, T1,... TN`. [heading Header] #include #include [heading Example] result_of::list_tie::type [endsect] [section vector_tie] [heading Description] Returns the result type of __vector_tie__. [heading Synopsis] template struct vector_tie; The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_VECTOR_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`T0, T1,... TN`] [Any type] [The arguments to `vector_tie`]] ] [heading Expression Semantics] result_of::vector_tie::type; [*Return type]: __vector__ [*Semantics]: Create a __vector__ of references from `T0, T1,... TN`. [heading Header] #include #include [heading Example] result_of::vector_tie::type [endsect] [section map_tie] [heading Description] Returns the result type of __map_tie__. [heading Synopsis] template struct map_tie; The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that defaults to `10`. You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change the default. Example: #define FUSION_MAX_MAP_SIZE 20 [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`K0, K1,... KN`] [Any type] [The key types for `map_tie`]] [[`D0, D1,... DN`] [Any type] [The arguments types for `map_tie`]] ] [heading Expression Semantics] result_of::map_tie::type; [*Return type]: __map__<__pair__, __pair__,... __pair__ > [*Semantics]: Create a __map__ of references from `D0, D1,... DN` with keys `K0, K1,... KN` [heading Header] #include #include [heading Example] struct int_key; struct double_key; ... result_of::map_tie::type [endsect] [endsect] [endsect] [section Conversion] All fusion sequences can be converted to one of the __containers__ types using one of these conversion functions. [heading Header] #include [section Functions] [section as_list] [heading Description] Convert a fusion sequence to a __list__. [heading Synopsis] template typename result_of::as_list::type as_list(Sequence& seq); template typename result_of::as_list::type as_list(Sequence const& seq); [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`seq`] [An instance of Sequence] [The sequence to convert.]] ] [heading Expression Semantics] as_list(seq); [*Return type]: __result_of_as_list__`::type` [*Semantics]: Convert a fusion sequence, `seq`, to a __list__. [heading Header] #include #include [heading Example] as_list(__make_vector__('x', 123, "hello")) [endsect] [section as_vector] [heading Description] Convert a fusion sequence to a __vector__. [heading Synopsis] template typename result_of::as_vector::type as_vector(Sequence& seq); template typename result_of::as_vector::type as_vector(Sequence const& seq); [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`seq`] [An instance of Sequence] [The sequence to convert.]] ] [heading Expression Semantics] as_vector(seq); [*Return type]: __result_of_as_vector__`::type` [*Semantics]: Convert a fusion sequence, `seq`, to a __vector__. [heading Header] #include #include [heading Example] as_vector(__make_list__('x', 123, "hello")) [endsect] [section as_set] [heading Description] Convert a fusion sequence to a __set__. [heading Synopsis] template typename result_of::as_set::type as_set(Sequence& seq); template typename result_of::as_set::type as_set(Sequence const& seq); [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`seq`] [An instance of Sequence] [The sequence to convert.]] ] [heading Expression Semantics] as_set(seq); [*Return type]: __result_of_as_set__`::type` [*Semantics]: Convert a fusion sequence, `seq`, to a __set__. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] as_set(__make_vector__('x', 123, "hello")) [endsect] [section as_map] [heading Description] Convert a fusion sequence to a __map__. [heading Synopsis] template typename result_of::as_map::type as_map(Sequence& seq); template typename result_of::as_map::type as_map(Sequence const& seq); [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`seq`] [An instance of Sequence] [The sequence to convert.]] ] [heading Expression Semantics] as_map(seq); [*Return type]: __result_of_as_map__`::type` [*Semantics]: Convert a fusion sequence, `seq`, to a __map__. [*Precondition]: The elements of the sequence are assumed to be __fusion_pair__s. There may be no duplicate __fusion_pair__ key types. [heading Header] #include #include [heading Example] as_map(__make_vector__( __fusion_make_pair__('X') , __fusion_make_pair__("Men"))) [endsect] [endsect] [section Metafunctions] [section as_list] [heading Description] Returns the result type of __as_list__. [heading Synopsis] template struct as_list; [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`Sequence`] [A fusion __sequence__] [The sequence type to convert.]] ] [heading Expression Semantics] result_of::as_list::type; [*Return type]: A __list__ with same elements as the input sequence, `Sequence`. [*Semantics]: Convert a fusion sequence, `Sequence`, to a __list__. [heading Header] #include #include [heading Example] result_of::as_list<__vector__ >::type [endsect] [section as_vector] [heading Description] Returns the result type of __as_vector__. [heading Synopsis] template struct as_vector; [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] ] [heading Expression Semantics] result_of::as_vector::type; [*Return type]: A __vector__ with same elements as the input sequence, `Sequence`. [*Semantics]: Convert a fusion sequence, `Sequence`, to a __vector__. [heading Header] #include #include [heading Example] result_of::as_vector<__list__ >::type [endsect] [section as_set] [heading Description] Returns the result type of __as_set__. [heading Synopsis] template struct as_set; [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] ] [heading Expression Semantics] result_of::as_set::type; [*Return type]: A __set__ with same elements as the input sequence, `Sequence`. [*Semantics]: Convert a fusion sequence, `Sequence`, to a __set__. [*Precondition]: There may be no duplicate key types. [heading Header] #include #include [heading Example] result_of::as_set<__vector__ >::type [endsect] [section as_map] [heading Description] Returns the result type of __as_map__. [heading Synopsis] template struct as_map; [heading Parameters] [table [[Parameter] [Requirement] [Description]] [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] ] [heading Expression Semantics] result_of::as_map::type; [*Return type]: A __map__ with same elements as the input sequence, `Sequence`. [*Semantics]: Convert a fusion sequence, `Sequence`, to a __map__. [*Precondition]: The elements of the sequence are assumed to be __fusion_pair__s. There may be no duplicate __fusion_pair__ key types. [heading Header] #include #include [heading Example] result_of::as_map<__vector__< __fusion_pair__ , __fusion_pair__ > >::type [endsect] [endsect] [endsect] [endsect]