mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-30 12:37:29 +02:00
doc updates to reflect structure changes
[SVN r40827]
This commit is contained in:
155
doc/adapted.qbk
Normal file
155
doc/adapted.qbk
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
[section Adapted]
|
||||||
|
|
||||||
|
Fusion provides a couple of adapters for other sequences such as
|
||||||
|
`std::pair`, __mpl__ sequences, and `boost::array`. These adapters are
|
||||||
|
written using Fusion's non-intrusive __extension__ mechanism. If you wish
|
||||||
|
to use these sequences with fusion, simply include the necessary files and
|
||||||
|
they will be regarded as first-class, fully conforming fusion sequences
|
||||||
|
[footnote Fusion sequences may also be adapted as fully conforming __mpl__
|
||||||
|
sequences (see __intrinsics__). That way, we can have 2-way adaptation to
|
||||||
|
and from __mpl__ and Fusion].
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted.hpp>
|
||||||
|
|
||||||
|
[section std::pair]
|
||||||
|
|
||||||
|
This module provides adapters for `std::pair`. Including the module header
|
||||||
|
makes `std::pair` a fully conforming __random_access_sequence__.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/std_pair.hpp>
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __random_access_sequence__
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
std::pair<int, std::string> p(123, "Hola!!!");
|
||||||
|
std::cout << __at_c__<0>(p) << std::endl;
|
||||||
|
std::cout << __at_c__<1>(p) << std::endl;
|
||||||
|
std::cout << p << std::endl;
|
||||||
|
|
||||||
|
[heading See also]
|
||||||
|
|
||||||
|
__std_pair_doc__, __tr1_tuple_pair__
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section mpl sequence]
|
||||||
|
|
||||||
|
This module provides adapters for __mpl__ sequences. Including the module
|
||||||
|
header makes all __mpl__ sequences fully conforming fusion sequences.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/mpl.hpp>
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__ (If the __mpl__ sequence is a forward sequence.)
|
||||||
|
* __bidirectional_sequence__ (If the __mpl__ sequence is a bidirectional sequence.)
|
||||||
|
* __random_access_sequence__ (If the __mpl__ sequence is a random access sequence.)
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
mpl::vector_c<int, 123, 456> vec_c;
|
||||||
|
fusion::vector2<int, long> v(vec_c);
|
||||||
|
std::cout << __at_c__<0>(v) << std::endl;
|
||||||
|
std::cout << __at_c__<1>(v) << std::endl;
|
||||||
|
|
||||||
|
v = mpl::vector_c<int, 456, 789>();
|
||||||
|
std::cout << __at_c__<0>(v) << std::endl;
|
||||||
|
std::cout << __at_c__<1>(v) << std::endl;
|
||||||
|
|
||||||
|
[heading See also]
|
||||||
|
|
||||||
|
__mpl__
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section boost::array]
|
||||||
|
|
||||||
|
This module provides adapters for `boost::array`. Including the module
|
||||||
|
header makes `boost::array` a fully conforming __random_access_sequence__.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/array.hpp>
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __random_access_sequence__
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
boost::array<int,3> arr = {{1,2,3}};
|
||||||
|
|
||||||
|
std::cout << *__begin__(arr) << std::endl;
|
||||||
|
std::cout << *__next__(__begin__(arr)) << std::endl;
|
||||||
|
std::cout << *__advance_c__<2>(__begin__(arr)) << std::endl;
|
||||||
|
std::cout << *__prior__(__end__(arr)) << std::endl;
|
||||||
|
std::cout << __at_c__<2>(arr) << std::endl;
|
||||||
|
|
||||||
|
[heading See also]
|
||||||
|
|
||||||
|
__boost_array_library__
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section boost::tuple]
|
||||||
|
This module provides adapters for `boost::tuple`. Including the module
|
||||||
|
header makes `boost::tuple` a fully conforming __forward_sequence__.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/boost_tuple.hpp>
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
boost::tuple<int,std::string> example_tuple(101, "hello");
|
||||||
|
std::cout << *boost::fusion::begin(example_tuple) << '\n';
|
||||||
|
std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n';
|
||||||
|
|
||||||
|
[heading See also]
|
||||||
|
|
||||||
|
__boost_tuple_library__
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section boost::variant]
|
||||||
|
This module provides adapters for `boost::variant`. Including the module
|
||||||
|
header makes `boost::variant` a fully conforming __forward_sequence__.
|
||||||
|
The variant acts as a sequence of the types that can be contained in the variant.
|
||||||
|
Accessing types not currently stored int the variant will lead to the variant
|
||||||
|
being populated with a default constructed value of that type.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/variant.hpp>
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
boost::variant<int,std::string> example_variant = 101;
|
||||||
|
std::cout << example_variant << '\n';
|
||||||
|
*boost::fusion::find<std::string>(example_variant) = "hello";
|
||||||
|
std::cout << example_variant << '\n';
|
||||||
|
|
||||||
|
[heading See also]
|
||||||
|
|
||||||
|
__boost_variant_library__
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[endsect]
|
@ -35,6 +35,7 @@ may use one of the __conversion__ functions to convert back to the original
|
|||||||
sequence type.
|
sequence type.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm.hpp>
|
#include <boost/fusion/algorithm.hpp>
|
||||||
|
|
||||||
[section Iteration]
|
[section Iteration]
|
||||||
@ -43,6 +44,7 @@ The iteration algorithms provide the fundamental algorithms for traversing
|
|||||||
a sequence repeatedly applying an operation to its elements.
|
a sequence repeatedly applying an operation to its elements.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration.hpp>
|
#include <boost/fusion/algorithm/iteration.hpp>
|
||||||
|
|
||||||
[section Functions]
|
[section Functions]
|
||||||
@ -79,6 +81,7 @@ For a sequence `Seq`, initial state, and binary function object or function poin
|
|||||||
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -130,6 +133,7 @@ For a sequence `Seq`, initial state, and binary function object or function poin
|
|||||||
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
|
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -179,6 +183,7 @@ Applies a unary function object to each element of a sequence.
|
|||||||
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
Linear, exactly `__result_of_size__<Sequence>::value` applications of `f`.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -235,6 +240,7 @@ type `State` and binary function object or function pointer of type `F`.
|
|||||||
Linear, exactly `__result_of_size__<Sequence>::value` applications of `F`.
|
Linear, exactly `__result_of_size__<Sequence>::value` applications of `F`.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
#include <boost/fusion/algorithm/iteration/fold.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -273,6 +279,7 @@ type `State` and binary function object or function pointer of type `F`.
|
|||||||
Linear, exactly `__result_of_size__<Sequence>::value` applications of `F`.
|
Linear, exactly `__result_of_size__<Sequence>::value` applications of `F`.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
|
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -311,6 +318,7 @@ The return type is always `void`.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -323,6 +331,7 @@ Constant.
|
|||||||
The query algorithms provide support for searching and analyzing sequences.
|
The query algorithms provide support for searching and analyzing sequences.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query.hpp>
|
#include <boost/fusion/algorithm/query.hpp>
|
||||||
|
|
||||||
[section Functions]
|
[section Functions]
|
||||||
@ -357,6 +366,7 @@ For a sequence `seq` and unary function object `f`, `any` returns true if `f` re
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/any.hpp>
|
#include <boost/fusion/algorithm/query/any.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -404,6 +414,7 @@ For a sequence `seq` and unary function object `f`, `all` returns true if `f` re
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/all.hpp>
|
#include <boost/fusion/algorithm/query/all.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -451,6 +462,7 @@ For a sequence `seq` and unary function object `f`, `none` returns true if `f` r
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/none.hpp>
|
#include <boost/fusion/algorithm/query/none.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -504,6 +516,7 @@ Equivalent to `__find_if__<boost::is_same<_, T> >(seq)`
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/find.hpp>
|
#include <boost/fusion/algorithm/query/find.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -549,8 +562,8 @@ or `__end__(seq)` if there is no such element.
|
|||||||
[heading Complexity]
|
[heading Complexity]
|
||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
|
||||||
#include <boost/fusion/algorithm/query/find_if.hpp>
|
/algorithm/query/find_if.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
const __vector__<double,int> vec(1.0,2);
|
const __vector__<double,int> vec(1.0,2);
|
||||||
@ -589,6 +602,7 @@ Returns the number of elements of a given type within a sequence.
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/count.hpp>
|
#include <boost/fusion/algorithm/query/count.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -628,6 +642,7 @@ Returns the number of elements within a sequence with a type for which a given u
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/count_if.hpp>
|
#include <boost/fusion/algorithm/query/count_if.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -672,6 +687,7 @@ A metafunction returning the result type of __any__.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/any.hpp>
|
#include <boost/fusion/algorithm/query/any.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -708,6 +724,7 @@ A metafunction returning the result type of __all__.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/all.hpp>
|
#include <boost/fusion/algorithm/query/all.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -744,6 +761,7 @@ A metafunction returning the result type of __none__.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/none.hpp>
|
#include <boost/fusion/algorithm/query/none.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -780,6 +798,7 @@ Returns the result type of `find`, given the sequence and search types.
|
|||||||
Linear, at most `__result_of_size__<Sequence>::value` comparisons.
|
Linear, at most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/find.hpp>
|
#include <boost/fusion/algorithm/query/find.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -816,6 +835,7 @@ Returns the result type of `find_if` given the sequence and predicate types.
|
|||||||
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
Linear. At most `__result_of_size__<Sequence>::value` comparisons.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/find_if.hpp>
|
#include <boost/fusion/algorithm/query/find_if.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -852,6 +872,7 @@ A metafunction that returns the result type of `count` given the sequence and se
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/count.hpp>
|
#include <boost/fusion/algorithm/query/count.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -888,6 +909,7 @@ A metafunction that returns the result type of `count_if` given the sequence and
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/query/count_if.hpp>
|
#include <boost/fusion/algorithm/query/count_if.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -904,6 +926,7 @@ it is important that the lifetime of the input arguments is greater than the
|
|||||||
period during which you wish to use the results.]
|
period during which you wish to use the results.]
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation.hpp>
|
#include <boost/fusion/algorithm/transformation.hpp>
|
||||||
|
|
||||||
[section Functions]
|
[section Functions]
|
||||||
@ -938,6 +961,7 @@ Equivalent to `__filter_if__<boost::same_type<_, T> >(seq)`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/filter.hpp>
|
#include <boost/fusion/algorithm/transformation/filter.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -977,6 +1001,7 @@ to `boost::mpl::true_`. The order of the retained elements is the same as in the
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1036,6 +1061,7 @@ with elements created by applying `f(e)` to each element of `e` of `seq`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1084,6 +1110,7 @@ Replaces each value within a sequence of a given type and value with a new value
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/replace.hpp>
|
#include <boost/fusion/algorithm/transformation/replace.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1124,6 +1151,7 @@ with `new_value` assigned to each element for which `f` evaluates to `true`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/replace_if.hpp>
|
#include <boost/fusion/algorithm/transformation/replace_if.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1170,6 +1198,7 @@ those of type `T`. Equivalent to `__remove_if__<boost::is_same<_,T> >(seq)`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/remove.hpp>
|
#include <boost/fusion/algorithm/transformation/remove.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1210,6 +1239,7 @@ Equivalent to `__filter__<boost::mpl::not_<Pred> >(seq)`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/remove_if.hpp>
|
#include <boost/fusion/algorithm/transformation/remove_if.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1245,6 +1275,7 @@ Returns a new sequence with the elements of the original in reverse order.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/reverse.hpp>
|
#include <boost/fusion/algorithm/transformation/reverse.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1279,6 +1310,7 @@ __clear__ returns an empty sequence.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/clear.hpp>
|
#include <boost/fusion/algorithm/transformation/clear.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1333,6 +1365,7 @@ in the range [`first`,`last`).
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/erase.hpp>
|
#include <boost/fusion/algorithm/transformation/erase.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1372,6 +1405,7 @@ elements of the original except those with a given key.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
|
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1412,6 +1446,7 @@ type and value of `t` inserted at iterator `pos`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/insert.hpp>
|
#include <boost/fusion/algorithm/transformation/insert.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1453,6 +1488,7 @@ Returns a new sequence with another sequence inserted at a specified iterator.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/insert_range.hpp>
|
#include <boost/fusion/algorithm/transformation/insert_range.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1489,6 +1525,7 @@ Takes 2 sequences and returns a sequence containing the elements of the first fo
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/join.hpp>
|
#include <boost/fusion/algorithm/transformation/join.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1529,6 +1566,7 @@ Zips sequences together to form a single sequence, whos members are tuples of th
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/zip.hpp>
|
#include <boost/fusion/algorithm/transformation/zip.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1565,6 +1603,7 @@ Returns a new sequence, with the last element of the original removed.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/pop_back.hpp>
|
#include <boost/fusion/algorithm/transformation/pop_back.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1600,6 +1639,7 @@ Returns a new sequence, with the first element of the original removed.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/pop_front.hpp>
|
#include <boost/fusion/algorithm/transformation/pop_front.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1637,6 +1677,7 @@ Returns a new sequence with an element added at the end.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/push_back.hpp>
|
#include <boost/fusion/algorithm/transformation/push_back.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1674,6 +1715,7 @@ Returns a new sequence with an element added at the beginning.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/push_front.hpp>
|
#include <boost/fusion/algorithm/transformation/push_front.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1717,6 +1759,7 @@ Returns the result type of __filter__ given the sequence type and type to retain
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/filter.hpp>
|
#include <boost/fusion/algorithm/transformation/filter.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -1753,6 +1796,7 @@ Returns the result type of __filter_if__ given the sequence and unary __mpl_lamb
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -1808,6 +1852,7 @@ with elements created by applying `f(e)` to each element of `e` of `seq`.
|
|||||||
Constant. Returns a view which is lazily evaluated.
|
Constant. Returns a view which is lazily evaluated.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
#include <boost/fusion/algorithm/transformation/transform.hpp>
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
@ -1857,6 +1902,7 @@ Returns the result type of __replace__, given the types of the input sequence an
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/replace.hpp>
|
#include <boost/fusion/algorithm/transformation/replace.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -1894,6 +1940,7 @@ Returns the result type of __replace_if__, given the types of the sequence, __po
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/replace_if.hpp>
|
#include <boost/fusion/algorithm/transformation/replace_if.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -1930,6 +1977,7 @@ Returns the result type of __remove__, given the sequence and removal types.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/remove.hpp>
|
#include <boost/fusion/algorithm/transformation/remove.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -1966,6 +2014,7 @@ Returns the result type of __remove_if__, given the input sequence and unary __m
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/remove_if.hpp>
|
#include <boost/fusion/algorithm/transformation/remove_if.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2000,6 +2049,7 @@ Returns the result type of __reverse__, given the input sequence type.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/reverse.hpp>
|
#include <boost/fusion/algorithm/transformation/reverse.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2034,6 +2084,7 @@ Returns the result type of __clear__, given the input sequence type.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/clear.hpp>
|
#include <boost/fusion/algorithm/transformation/clear.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2077,6 +2128,7 @@ Returns the result type of __erase__, given the input sequence and range delimit
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/erase.hpp>
|
#include <boost/fusion/algorithm/transformation/erase.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2113,6 +2165,7 @@ Returns the result type of __erase_key__, given the sequence and key types.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
|
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2151,6 +2204,7 @@ Returns the result type of __insert__, given the sequence, position iterator and
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/insert.hpp>
|
#include <boost/fusion/algorithm/transformation/insert.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2189,6 +2243,7 @@ Returns the result type of __insert_range__, given the input sequence, position
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/insert_range.hpp>
|
#include <boost/fusion/algorithm/transformation/insert_range.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2219,6 +2274,7 @@ Returns the result of joining 2 sequences, given the sequence types.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/join.hpp>
|
#include <boost/fusion/algorithm/transformation/join.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2251,6 +2307,7 @@ Zips sequences together to form a single sequence, whos members are tuples of th
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/transformation/zip.hpp>
|
#include <boost/fusion/algorithm/transformation/zip.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2285,6 +2342,7 @@ Returns the result type of __pop_back__, given the input sequence type.
|
|||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
[heading Header]
|
||||||
|
|
||||||
#include <boost/fusion/algorithm/tranformation/pop_back.hpp>
|
#include <boost/fusion/algorithm/tranformation/pop_back.hpp>
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -2318,8 +2376,7 @@ Returns the result type of __pop_front__, given the input sequence type.
|
|||||||
[heading Complexity]
|
[heading Complexity]
|
||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
/algorithm/transformation/pop_front.hpp>
|
||||||
#include <boost/fusion/algorithm/transformation/pop_front.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@ -2354,8 +2411,7 @@ Returns the result type of __push_back__, given the types of the input sequence
|
|||||||
[heading Complexity]
|
[heading Complexity]
|
||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
/algorithm/transformation/push_back.hpp>
|
||||||
#include <boost/fusion/algorithm/transformation/push_back.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@ -2390,8 +2446,7 @@ Returns the result type of __push_front__, given the types of the input sequence
|
|||||||
[heading Complexity]
|
[heading Complexity]
|
||||||
Constant.
|
Constant.
|
||||||
|
|
||||||
[heading Header]
|
/algorithm/transformation/push_front.hpp>
|
||||||
#include <boost/fusion/algorithm/transformation/push_front.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
437
doc/container.qbk
Normal file
437
doc/container.qbk
Normal file
@ -0,0 +1,437 @@
|
|||||||
|
[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 <boost/fusion/container.hpp>
|
||||||
|
|
||||||
|
[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 <boost/fusion/container/vector.hpp>
|
||||||
|
#include <boost/fusion/container/vector/vector_fwd.hpp>
|
||||||
|
|
||||||
|
// numbered forms
|
||||||
|
#include <boost/fusion/container/vector/vector10.hpp>
|
||||||
|
#include <boost/fusion/container/vector/vector20.hpp>
|
||||||
|
#include <boost/fusion/container/vector/vector30.hpp>
|
||||||
|
#include <boost/fusion/container/vector/vector40.hpp>
|
||||||
|
#include <boost/fusion/container/vector/vector50.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
[*Numbered forms]
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct vector0;
|
||||||
|
|
||||||
|
template <typename T0>
|
||||||
|
struct vector1;
|
||||||
|
|
||||||
|
template <typename T0, typename T1>
|
||||||
|
struct vector2;
|
||||||
|
|
||||||
|
template <typename T0, typename T1, typename T2>
|
||||||
|
struct vector3;
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
template <typename T0, typename T1, typename T2..., typename TN>
|
||||||
|
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<int, char, double>
|
||||||
|
|
||||||
|
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<int, char, double>
|
||||||
|
|
||||||
|
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<int, float> 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 <boost/fusion/container/list/cons.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename Car, typename Cdr = nil>
|
||||||
|
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__<N>(l)`] [The Nth element from the beginning of the sequence; see __at__.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[blurb __note__ `__at__<N>(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<int, cons<float> > l(12, cons<float>(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 <boost/fusion/container/list.hpp>
|
||||||
|
#include <boost/fusion/container/list/list_forward.hpp>
|
||||||
|
|
||||||
|
[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<int, char, double>
|
||||||
|
|
||||||
|
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__<N>(l)`] [The Nth element from the beginning of the sequence; see __at__.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[blurb __note__ `__at__<n>(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<int, float> 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 <boost/fusion/container/set.hpp>
|
||||||
|
|
||||||
|
[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<int, char, double>
|
||||||
|
|
||||||
|
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<int, float> S;
|
||||||
|
S s(12, 5.5f);
|
||||||
|
std::cout << __at_key__<int>(s) << std::endl;
|
||||||
|
std::cout << __at_key__<float>(s) << std::endl;
|
||||||
|
std::cout << __result_of_has_key__<S, double>::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 <boost/fusion/container/map.hpp>
|
||||||
|
|
||||||
|
[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__<int, char>, __pair__<char, char>, __pair__<double, char> >
|
||||||
|
|
||||||
|
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__
|
||||||
|
* __forward_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 __random_access_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__<int, char>
|
||||||
|
, __pair__<double, std::string> >
|
||||||
|
map_type;
|
||||||
|
|
||||||
|
map_type m(
|
||||||
|
__fusion_make_pair__<int>('X')
|
||||||
|
, __fusion_make_pair__<double>("Men"));
|
||||||
|
|
||||||
|
std::cout << __at_key__<int>(m) << std::endl;
|
||||||
|
std::cout << __at_key__<double>(m) << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[endsect]
|
@ -66,7 +66,7 @@ that can be used in conjuction with `boost::enable_if` to provide tag
|
|||||||
support for groups of related types. This feature is not necessary
|
support for groups of related types. This feature is not necessary
|
||||||
for our sequence, but for an example see the code in:
|
for our sequence, but for an example see the code in:
|
||||||
|
|
||||||
#include <boost/fusion/sequence/adapted/mpl/tag_of.hpp>
|
#include <boost/fusion/adapted/array/tag_of.hpp>
|
||||||
|
|
||||||
[heading Designing a suitable iterator]
|
[heading Designing a suitable iterator]
|
||||||
|
|
||||||
@ -411,8 +411,7 @@ The user must the implement the key expressions required by their sequence type.
|
|||||||
[[`sequence::template value_at<Sequence, N>::type`][The type of the `N`th element in a sequence of type `Seq`]]
|
[[`sequence::template value_at<Sequence, N>::type`][The type of the `N`th element in a sequence of type `Seq`]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading Header]
|
/sequence/sequence_facade.hpp>
|
||||||
#include <boost/fusion/sequence/sequence_facade.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@ -493,8 +492,7 @@ part of the sequence.
|
|||||||
The macro should be used at global scope, and `struct_name` should be the fully
|
The macro should be used at global scope, and `struct_name` should be the fully
|
||||||
namespace qualified name of the struct to be converted.
|
namespace qualified name of the struct to be converted.
|
||||||
|
|
||||||
[heading Header]
|
/adapted/struct/adapt_struct.hpp>
|
||||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
namespace demo
|
namespace demo
|
||||||
@ -546,8 +544,7 @@ that will be part of the sequence.
|
|||||||
The macro should be used at global scope, and `struct_name` should be the fully
|
The macro should be used at global scope, and `struct_name` should be the fully
|
||||||
namespace qualified name of the struct to be converted.
|
namespace qualified name of the struct to be converted.
|
||||||
|
|
||||||
[heading Header]
|
/adapted/struct/adapt_assoc_struct.hpp>
|
||||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
namespace demo
|
namespace demo
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
Components to call functions and function objects and to make Fusion code
|
Components to call functions and function objects and to make Fusion code
|
||||||
callable through a function object interface.
|
callable through a function object interface.
|
||||||
|
|
||||||
[heading Header]
|
/functional.hpp>
|
||||||
#include <boost/fusion/functional.hpp>
|
|
||||||
|
|
||||||
[heading Fused and unfused forms]
|
[heading Fused and unfused forms]
|
||||||
|
|
||||||
@ -283,8 +282,7 @@ arguments.
|
|||||||
[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns
|
[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns
|
||||||
the result of the call expression.
|
the result of the call expression.
|
||||||
|
|
||||||
[heading Header]
|
/functional/invocation/invoke.hpp>
|
||||||
#include <boost/fusion/functional/invocation/invoke.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
__std_plus_doc__<int> add;
|
__std_plus_doc__<int> add;
|
||||||
@ -347,8 +345,7 @@ implemented).
|
|||||||
|
|
||||||
[*Semantics]: Invokes `f` with the elements in `s` as arguments.
|
[*Semantics]: Invokes `f` with the elements in `s` as arguments.
|
||||||
|
|
||||||
[heading Header]
|
/functional/invocation/invoke_procedure.hpp>
|
||||||
#include <boost/fusion/functional/invocation/invoke_procedure.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
__vector__<int,int> v(1,2);
|
__vector__<int,int> v(1,2);
|
||||||
@ -405,8 +402,7 @@ arguments.
|
|||||||
[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns the
|
[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns the
|
||||||
result of the call expression.
|
result of the call expression.
|
||||||
|
|
||||||
[heading Header]
|
/functional/invocation/invoke_function_object.hpp>
|
||||||
#include <boost/fusion/functional/invocation/invoke_function_object.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
struct sub
|
struct sub
|
||||||
@ -548,8 +544,7 @@ In case of the latter, a freestanding [^get_pointer] function must be
|
|||||||
defined (Boost provides this function for [^std::auto_ptr] and
|
defined (Boost provides this function for [^std::auto_ptr] and
|
||||||
__boost_shared_ptr_call__).
|
__boost_shared_ptr_call__).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/fused.hpp>
|
||||||
#include <boost/fusion/functional/adapter/fused.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <typename Function>
|
template <typename Function>
|
||||||
@ -625,8 +620,7 @@ The target function must not be a pointer to a member object (dereferencing
|
|||||||
such a pointer without returning anything does not make sense, so this case
|
such a pointer without returning anything does not make sense, so this case
|
||||||
is not implemented).
|
is not implemented).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/fused_procedure.hpp>
|
||||||
#include <boost/fusion/functional/adapter/fused_procedure.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <typename Function>
|
template <typename Function>
|
||||||
@ -699,8 +693,7 @@ reference. Const qualification is preserved and propagated appropriately
|
|||||||
target function object that is const or, if the target function object
|
target function object that is const or, if the target function object
|
||||||
is held by value, the adapter is const).
|
is held by value, the adapter is const).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/fused_function_object.hpp>
|
||||||
#include <boost/fusion/functional/adapter/fused_function_object.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <class Function>
|
template <class Function>
|
||||||
@ -799,8 +792,7 @@ reference. Const qualification is preserved and propagated appropriately
|
|||||||
the target function object is const - or, in case the target function
|
the target function object is const - or, in case the target function
|
||||||
object is held by value, the adapter is const).
|
object is held by value, the adapter is const).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/unfused_generic.hpp>
|
||||||
#include <boost/fusion/functional/adapter/unfused_generic.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <class Function>
|
template <class Function>
|
||||||
@ -907,8 +899,7 @@ reference. Const qualification is preserved and propagated appropriately
|
|||||||
the target function object is const - or, in case the target function
|
the target function object is const - or, in case the target function
|
||||||
object is held by value, the adapter is const).
|
object is held by value, the adapter is const).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/unfused_lvalue_args.hpp>
|
||||||
#include <boost/fusion/functional/adapter/unfused_lvalue_args.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <class Function>
|
template <class Function>
|
||||||
@ -989,8 +980,7 @@ reference. Const qualification is preserved and propagated appropriately
|
|||||||
the target function object is const - or, in case the target function object
|
the target function object is const - or, in case the target function object
|
||||||
is held by value, the adapter is const).
|
is held by value, the adapter is const).
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/unfused_rvalue_args.hpp>
|
||||||
#include <boost/fusion/functional/adapter/unfused_rvalue_args.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <class Function>
|
template <class Function>
|
||||||
@ -1081,8 +1071,7 @@ Therefore the adapter is always treated as if it was const. ]
|
|||||||
non-reference elements, the element is copied only once - the call operator's
|
non-reference elements, the element is copied only once - the call operator's
|
||||||
signature is optimized automatically to avoid by-value parameters.]
|
signature is optimized automatically to avoid by-value parameters.]
|
||||||
|
|
||||||
[heading Header]
|
/functional/adapter/unfused_typed.hpp>
|
||||||
#include <boost/fusion/functional/adapter/unfused_typed.hpp>
|
|
||||||
|
|
||||||
[heading Synopsis]
|
[heading Synopsis]
|
||||||
template <class Function, class Sequence>
|
template <class Function, class Sequence>
|
||||||
|
231
doc/fusion.qbk
231
doc/fusion.qbk
@ -65,125 +65,125 @@
|
|||||||
[def __pair__ [link fusion.support.pair `pair`]]
|
[def __pair__ [link fusion.support.pair `pair`]]
|
||||||
[def __fusion_make_pair__ [link fusion.support.pair `make_pair`]]
|
[def __fusion_make_pair__ [link fusion.support.pair `make_pair`]]
|
||||||
|
|
||||||
[def __iterator__ [link fusion.iterators Iterator]]
|
[def __iterator__ [link fusion.iterator Iterator]]
|
||||||
[def __iterator_concepts__ [link fusion.iterators.concepts Iterator Concepts]]
|
[def __iterator_concepts__ [link fusion.iterator.concepts Iterator Concepts]]
|
||||||
[def __forward_iterator__ [link fusion.iterators.concepts.forward_iterator Forward Iterator]]
|
[def __forward_iterator__ [link fusion.iterator.concepts.forward_iterator Forward Iterator]]
|
||||||
[def __bidirectional_iterator__ [link fusion.iterators.concepts.bidirectional_iterator Bidirectional Iterator]]
|
[def __bidirectional_iterator__ [link fusion.iterator.concepts.bidirectional_iterator Bidirectional Iterator]]
|
||||||
[def __random_access_iterator__ [link fusion.iterators.concepts.random_access_iterator Random Access Iterator]]
|
[def __random_access_iterator__ [link fusion.iterator.concepts.random_access_iterator Random Access Iterator]]
|
||||||
|
|
||||||
[def __next__ [link fusion.iterators.functions.next `next`]]
|
[def __next__ [link fusion.iterator.functions.next `next`]]
|
||||||
[def __prior__ [link fusion.iterators.functions.prior `prior`]]
|
[def __prior__ [link fusion.iterator.functions.prior `prior`]]
|
||||||
[def __advance__ [link fusion.iterators.functions.advance `advance`]]
|
[def __advance__ [link fusion.iterator.functions.advance `advance`]]
|
||||||
[def __advance_c__ [link fusion.iterators.functions.advance_c `advance_c`]]
|
[def __advance_c__ [link fusion.iterator.functions.advance_c `advance_c`]]
|
||||||
[def __distance__ [link fusion.iterators.functions.distance `distance`]]
|
[def __distance__ [link fusion.iterator.functions.distance `distance`]]
|
||||||
[def __deref__ [link fusion.iterators.functions.deref `deref`]]
|
[def __deref__ [link fusion.iterator.functions.deref `deref`]]
|
||||||
|
|
||||||
[def __result_of_next__ [link fusion.iterators.metafunctions.next `result_of::next`]]
|
[def __result_of_next__ [link fusion.iterator.metafunctions.next `result_of::next`]]
|
||||||
[def __result_of_prior__ [link fusion.iterators.metafunctions.prior `result_of::prior`]]
|
[def __result_of_prior__ [link fusion.iterator.metafunctions.prior `result_of::prior`]]
|
||||||
[def __result_of_equal_to__ [link fusion.iterators.metafunctions.equal_to `result_of::equal_to`]]
|
[def __result_of_equal_to__ [link fusion.iterator.metafunctions.equal_to `result_of::equal_to`]]
|
||||||
[def __result_of_advance__ [link fusion.iterators.metafunctions.advance `result_of::advance`]]
|
[def __result_of_advance__ [link fusion.iterator.metafunctions.advance `result_of::advance`]]
|
||||||
[def __result_of_advance_c__ [link fusion.iterators.metafunctions.advance_c `result_of::advance_c`]]
|
[def __result_of_advance_c__ [link fusion.iterator.metafunctions.advance_c `result_of::advance_c`]]
|
||||||
[def __result_of_distance__ [link fusion.iterators.metafunctions.distance `result_of::distance`]]
|
[def __result_of_distance__ [link fusion.iterator.metafunctions.distance `result_of::distance`]]
|
||||||
[def __result_of_deref__ [link fusion.iterators.metafunctions.deref `result_of::deref`]]
|
[def __result_of_deref__ [link fusion.iterator.metafunctions.deref `result_of::deref`]]
|
||||||
[def __result_of_value_of__ [link fusion.iterators.metafunctions.value_of `result_of::value_of`]]
|
[def __result_of_value_of__ [link fusion.iterator.metafunctions.value_of `result_of::value_of`]]
|
||||||
[def __value_of__ [link fusion.iterators.metafunctions.value_of `value_of`]]
|
[def __value_of__ [link fusion.iterator.metafunctions.value_of `value_of`]]
|
||||||
|
|
||||||
[def __sequence__ [link fusion.sequences Sequence]]
|
[def __sequence__ [link fusion.sequence Sequence]]
|
||||||
[def __sequence_concepts__ [link fusion.sequences.concepts Sequence Concepts]]
|
[def __sequence_concepts__ [link fusion.sequence.concepts Sequence Concepts]]
|
||||||
[def __traversal_concept__ [link fusion.sequences.concepts.traversal Sequence Traversal Concept]]
|
[def __traversal_concept__ [link fusion.sequence.concepts.traversal Sequence Traversal Concept]]
|
||||||
[def __associativity_concept__ [link fusion.sequences.concepts.associativity Sequence Associativity Concept]]
|
[def __associativity_concept__ [link fusion.sequence.concepts.associativity Sequence Associativity Concept]]
|
||||||
[def __forward_sequence__ [link fusion.sequences.concepts.forward_sequence Forward Sequence]]
|
[def __forward_sequence__ [link fusion.sequence.concepts.forward_sequence Forward Sequence]]
|
||||||
[def __bidirectional_sequence__ [link fusion.sequences.concepts.bidirectional_sequence Bidirectional Sequence]]
|
[def __bidirectional_sequence__ [link fusion.sequence.concepts.bidirectional_sequence Bidirectional Sequence]]
|
||||||
[def __random_access_sequence__ [link fusion.sequences.concepts.random_access_sequence Random Access Sequence]]
|
[def __random_access_sequence__ [link fusion.sequence.concepts.random_access_sequence Random Access Sequence]]
|
||||||
[def __associative_sequence__ [link fusion.sequences.concepts.associative_sequence Associative Sequence]]
|
[def __associative_sequence__ [link fusion.sequence.concepts.associative_sequence Associative Sequence]]
|
||||||
|
|
||||||
[def __containers__ [link fusion.sequences.containers Containers]]
|
[def __containers__ [link fusion.container Container]]
|
||||||
[def __vector__ [link fusion.sequences.containers.vector `vector`]]
|
[def __vector__ [link fusion.container.vector `vector`]]
|
||||||
[def __cons__ [link fusion.sequences.containers.cons `cons`]]
|
[def __cons__ [link fusion.container.cons `cons`]]
|
||||||
[def __list__ [link fusion.sequences.containers.list `list`]]
|
[def __list__ [link fusion.container.list `list`]]
|
||||||
[def __set__ [link fusion.sequences.containers.set `set`]]
|
[def __set__ [link fusion.container.set `set`]]
|
||||||
[def __map__ [link fusion.sequences.containers.map `map`]]
|
[def __map__ [link fusion.container.map `map`]]
|
||||||
|
|
||||||
[def __view__ [link fusion.sequences.views View]]
|
[def __view__ [link fusion.view View]]
|
||||||
[def __views__ [link fusion.sequences.views Views]]
|
[def __views__ [link fusion.view Views]]
|
||||||
[def __single_view__ [link fusion.sequences.views.single_view `single_view`]]
|
[def __single_view__ [link fusion.view.single_view `single_view`]]
|
||||||
[def __filter_view__ [link fusion.sequences.views.filter_view `filter_view`]]
|
[def __filter_view__ [link fusion.view.filter_view `filter_view`]]
|
||||||
[def __iterator_range__ [link fusion.sequences.views.iterator_range `iterator_range`]]
|
[def __iterator_range__ [link fusion.view.iterator_range `iterator_range`]]
|
||||||
[def __joint_view__ [link fusion.sequences.views.joint_view `joint_view`]]
|
[def __joint_view__ [link fusion.view.joint_view `joint_view`]]
|
||||||
[def __transform_view__ [link fusion.sequences.views.transform_view `transform_view`]]
|
[def __transform_view__ [link fusion.view.transform_view `transform_view`]]
|
||||||
[def __reverse_view__ [link fusion.sequences.views.reverse_view `reverse_view`]]
|
[def __reverse_view__ [link fusion.view.reverse_view `reverse_view`]]
|
||||||
[def __zip_view__ [link fusion.sequences.views.zip_view `zip_view`]]
|
[def __zip_view__ [link fusion.view.zip_view `zip_view`]]
|
||||||
|
|
||||||
[def __std_pair__ [link fusion.sequences.adapted.std__pair `std::pair`]]
|
[def __std_pair__ [link fusion.adapted.std__pair `std::pair`]]
|
||||||
[def __boost_array__ [link fusion.sequences.adapted.boost__array `boost::array`]]
|
[def __boost_array__ [link fusion.adapted.boost__array `boost::array`]]
|
||||||
[def __mpl_sequence__ [link fusion.sequences.adapted.mpl_sequence mpl sequence]]
|
[def __mpl_sequence__ [link fusion.adapted.mpl_sequence mpl sequence]]
|
||||||
|
|
||||||
[def __intrinsic__ [link fusion.sequences.intrinsics Intrinsic]]
|
[def __intrinsic__ [link fusion.sequence.intrinsic Intrinsic]]
|
||||||
[def __intrinsics__ [link fusion.sequences.intrinsics Intrinsics]]
|
[def __intrinsics__ [link fusion.sequence.intrinsic Intrinsics]]
|
||||||
[def __begin__ [link fusion.sequences.intrinsics.functions.begin `begin`]]
|
[def __begin__ [link fusion.sequence.intrinsic.functions.begin `begin`]]
|
||||||
[def __result_of_begin__ [link fusion.sequences.intrinsics.metafunctions.begin `result_of::begin`]]
|
[def __result_of_begin__ [link fusion.sequence.intrinsic.metafunctions.begin `result_of::begin`]]
|
||||||
[def __end__ [link fusion.sequences.intrinsics.functions.end `end`]]
|
[def __end__ [link fusion.sequence.intrinsic.functions.end `end`]]
|
||||||
[def __result_of_end__ [link fusion.sequences.intrinsics.metafunctions.end `result_of::end`]]
|
[def __result_of_end__ [link fusion.sequence.intrinsic.metafunctions.end `result_of::end`]]
|
||||||
[def __size__ [link fusion.sequences.intrinsics.functions.size `size`]]
|
[def __size__ [link fusion.sequence.intrinsic.functions.size `size`]]
|
||||||
[def __result_of_size__ [link fusion.sequences.intrinsics.metafunctions.size `result_of::size`]]
|
[def __result_of_size__ [link fusion.sequence.intrinsic.metafunctions.size `result_of::size`]]
|
||||||
[def __empty__ [link fusion.sequences.intrinsics.functions.empty `empty`]]
|
[def __empty__ [link fusion.sequence.intrinsic.functions.empty `empty`]]
|
||||||
[def __result_of_empty__ [link fusion.sequences.intrinsics.metafunctions.empty `result_of::empty`]]
|
[def __result_of_empty__ [link fusion.sequence.intrinsic.metafunctions.empty `result_of::empty`]]
|
||||||
[def __front__ [link fusion.sequences.intrinsics.functions.front `front`]]
|
[def __front__ [link fusion.sequence.intrinsic.functions.front `front`]]
|
||||||
[def __result_of_front__ [link fusion.sequences.intrinsics.metafunctions.front `result_of::front`]]
|
[def __result_of_front__ [link fusion.sequence.intrinsic.metafunctions.front `result_of::front`]]
|
||||||
[def __back__ [link fusion.sequences.intrinsics.functions.back `back`]]
|
[def __back__ [link fusion.sequence.intrinsic.functions.back `back`]]
|
||||||
[def __result_of_back__ [link fusion.sequences.intrinsics.metafunctions.back `result_of::back`]]
|
[def __result_of_back__ [link fusion.sequence.intrinsic.metafunctions.back `result_of::back`]]
|
||||||
[def __at__ [link fusion.sequences.intrinsics.functions.at `at`]]
|
[def __at__ [link fusion.sequence.intrinsic.functions.at `at`]]
|
||||||
[def __result_of_at__ [link fusion.sequences.intrinsics.metafunctions.at `result_of::at`]]
|
[def __result_of_at__ [link fusion.sequence.intrinsic.metafunctions.at `result_of::at`]]
|
||||||
[def __at_c__ [link fusion.sequences.intrinsics.functions.at_c `at_c`]]
|
[def __at_c__ [link fusion.sequence.intrinsic.functions.at_c `at_c`]]
|
||||||
[def __result_of_at_c__ [link fusion.sequences.intrinsics.metafunctions.at_c `result_of::at_c`]]
|
[def __result_of_at_c__ [link fusion.sequence.intrinsic.metafunctions.at_c `result_of::at_c`]]
|
||||||
[def __at_key__ [link fusion.sequences.intrinsics.functions.at_key `at_key`]]
|
[def __at_key__ [link fusion.sequence.intrinsic.functions.at_key `at_key`]]
|
||||||
[def __result_of_at_key__ [link fusion.sequences.intrinsics.metafunctions.at_key `result_of::at_key`]]
|
[def __result_of_at_key__ [link fusion.sequence.intrinsic.metafunctions.at_key `result_of::at_key`]]
|
||||||
[def __has_key__ [link fusion.sequences.intrinsics.functions.has_key `has_key`]]
|
[def __has_key__ [link fusion.sequence.intrinsic.functions.has_key `has_key`]]
|
||||||
[def __result_of_has_key__ [link fusion.sequences.intrinsics.metafunctions.has_key `result_of::has_key`]]
|
[def __result_of_has_key__ [link fusion.sequence.intrinsic.metafunctions.has_key `result_of::has_key`]]
|
||||||
[def __value_at_key__ [link fusion.sequences.intrinsics.metafunctions.value_at_key `value_at_key`]]
|
[def __value_at_key__ [link fusion.sequence.intrinsic.metafunctions.value_at_key `value_at_key`]]
|
||||||
[def __result_of_value_at__ [link fusion.sequences.intrinsics.metafunctions.value_at `result_of::value_at`]]
|
[def __result_of_value_at__ [link fusion.sequence.intrinsic.metafunctions.value_at `result_of::value_at`]]
|
||||||
[def __result_of_value_at_c__ [link fusion.sequences.intrinsics.metafunctions.value_at_c `result_of::value_at_c`]]
|
[def __result_of_value_at_c__ [link fusion.sequence.intrinsic.metafunctions.value_at_c `result_of::value_at_c`]]
|
||||||
[def __result_of_value_at_key__ [link fusion.sequences.intrinsics.metafunctions.value_at_key `result_of::value_at_key`]]
|
[def __result_of_value_at_key__ [link fusion.sequence.intrinsic.metafunctions.value_at_key `result_of::value_at_key`]]
|
||||||
|
|
||||||
[def __conversion__ [link fusion.sequences.conversion.functions Conversion]]
|
[def __conversion__ [link fusion.sequence.conversion.functions Conversion]]
|
||||||
[def __result_of_conversion__ [link fusion.sequences.conversion.metafunctions Conversion Metafunctions]]
|
[def __result_of_conversion__ [link fusion.sequence.conversion.metafunctions Conversion Metafunctions]]
|
||||||
[def __as_vector__ [link fusion.sequences.conversion.functions.as_vector `as_vector`]]
|
[def __as_vector__ [link fusion.sequence.conversion.functions.as_vector `as_vector`]]
|
||||||
[def __result_of_as_vector__ [link fusion.sequences.conversion.metafunctions.as_vector `result_of::as_vector`]]
|
[def __result_of_as_vector__ [link fusion.sequence.conversion.metafunctions.as_vector `result_of::as_vector`]]
|
||||||
[def __as_list__ [link fusion.sequences.conversion.functions.as_list `as_list`]]
|
[def __as_list__ [link fusion.sequence.conversion.functions.as_list `as_list`]]
|
||||||
[def __result_of_as_list__ [link fusion.sequences.conversion.metafunctions.as_list `result_of::as_list`]]
|
[def __result_of_as_list__ [link fusion.sequence.conversion.metafunctions.as_list `result_of::as_list`]]
|
||||||
[def __as_set__ [link fusion.sequences.conversion.functions.as_set `as_set`]]
|
[def __as_set__ [link fusion.sequence.conversion.functions.as_set `as_set`]]
|
||||||
[def __result_of_as_set__ [link fusion.sequences.conversion.metafunctions.as_set `result_of::as_set`]]
|
[def __result_of_as_set__ [link fusion.sequence.conversion.metafunctions.as_set `result_of::as_set`]]
|
||||||
[def __as_map__ [link fusion.sequences.conversion.functions.as_map `as_map`]]
|
[def __as_map__ [link fusion.sequence.conversion.functions.as_map `as_map`]]
|
||||||
[def __result_of_as_map__ [link fusion.sequences.conversion.metafunctions.as_map `result_of::as_map`]]
|
[def __result_of_as_map__ [link fusion.sequence.conversion.metafunctions.as_map `result_of::as_map`]]
|
||||||
|
|
||||||
[def __generation__ [link fusion.sequences.generation.functions Generation]]
|
[def __generation__ [link fusion.sequence.generation.functions Generation]]
|
||||||
[def __result_of_generation__ [link fusion.sequences.generation.metafunctions Generation Metafunctions]]
|
[def __result_of_generation__ [link fusion.sequence.generation.metafunctions Generation Metafunctions]]
|
||||||
[def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]]
|
[def __make_vector__ [link fusion.sequence.generation.functions.make_vector `make_vector`]]
|
||||||
[def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]]
|
[def __result_of_make_vector__ [link fusion.sequence.generation.metafunctions.make_vector `result_of::make_vector`]]
|
||||||
[def __vector_tie__ [link fusion.sequences.generation.functions.vector_tie `vector_tie`]]
|
[def __vector_tie__ [link fusion.sequence.generation.functions.vector_tie `vector_tie`]]
|
||||||
[def __map_tie__ [link fusion.sequences.generation.functions.vector_tie `map_tie`]]
|
[def __map_tie__ [link fusion.sequence.generation.functions.vector_tie `map_tie`]]
|
||||||
[def __result_of_vector_tie__ [link fusion.sequences.generation.metafunctions.vector_tie `result_of::vector_tie`]]
|
[def __result_of_vector_tie__ [link fusion.sequence.generation.metafunctions.vector_tie `result_of::vector_tie`]]
|
||||||
[def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]]
|
[def __make_vector__ [link fusion.sequence.generation.functions.make_vector `make_vector`]]
|
||||||
[def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]]
|
[def __result_of_make_vector__ [link fusion.sequence.generation.metafunctions.make_vector `result_of::make_vector`]]
|
||||||
[def __make_cons__ [link fusion.sequences.generation.functions.make_cons `make_cons`]]
|
[def __make_cons__ [link fusion.sequence.generation.functions.make_cons `make_cons`]]
|
||||||
[def __result_of_make_cons__ [link fusion.sequences.generation.metafunctions.make_cons `result_of::make_cons`]]
|
[def __result_of_make_cons__ [link fusion.sequence.generation.metafunctions.make_cons `result_of::make_cons`]]
|
||||||
[def __make_list__ [link fusion.sequences.generation.functions.make_list `make_list`]]
|
[def __make_list__ [link fusion.sequence.generation.functions.make_list `make_list`]]
|
||||||
[def __result_of_make_list__ [link fusion.sequences.generation.metafunctions.make_list `result_of::make_list`]]
|
[def __result_of_make_list__ [link fusion.sequence.generation.metafunctions.make_list `result_of::make_list`]]
|
||||||
[def __make_set__ [link fusion.sequences.generation.functions.make_set `make_set`]]
|
[def __make_set__ [link fusion.sequence.generation.functions.make_set `make_set`]]
|
||||||
[def __result_of_make_set__ [link fusion.sequences.generation.metafunctions.make_set `result_of::make_set`]]
|
[def __result_of_make_set__ [link fusion.sequence.generation.metafunctions.make_set `result_of::make_set`]]
|
||||||
[def __make_map__ [link fusion.sequences.generation.functions.make_map `make_map`]]
|
[def __make_map__ [link fusion.sequence.generation.functions.make_map `make_map`]]
|
||||||
[def __result_of_make_map__ [link fusion.sequences.generation.metafunctions.make_map `result_of::make_map`]]
|
[def __result_of_make_map__ [link fusion.sequence.generation.metafunctions.make_map `result_of::make_map`]]
|
||||||
[def __list_tie__ [link fusion.sequences.generation.functions.list_tie `list_tie`]]
|
[def __list_tie__ [link fusion.sequence.generation.functions.list_tie `list_tie`]]
|
||||||
[def __result_of_list_tie__ [link fusion.sequences.generation.metafunctions.list_tie `result_of::list_tie`]]
|
[def __result_of_list_tie__ [link fusion.sequence.generation.metafunctions.list_tie `result_of::list_tie`]]
|
||||||
|
|
||||||
[def __out__ [link fusion.sequences.operators.i_o.out out]]
|
[def __out__ [link fusion.sequence.operator.i_o.out out]]
|
||||||
[def __in__ [link fusion.sequences.operators.i_o.in in]]
|
[def __in__ [link fusion.sequence.operator.i_o.in in]]
|
||||||
[def __eq__ [link fusion.sequences.operators.comparison.equal equal]]
|
[def __eq__ [link fusion.sequence.operator.comparison.equal equal]]
|
||||||
[def __neq__ [link fusion.sequences.operators.comparison.not_equal not equal]]
|
[def __neq__ [link fusion.sequence.operator.comparison.not_equal not equal]]
|
||||||
[def __lt__ [link fusion.sequences.operators.comparison.less_than less than]]
|
[def __lt__ [link fusion.sequence.operator.comparison.less_than less than]]
|
||||||
[def __lte__ [link fusion.sequences.operators.comparison.less_than_equal less than equal]]
|
[def __lte__ [link fusion.sequence.operator.comparison.less_than_equal less than equal]]
|
||||||
[def __gt__ [link fusion.sequences.operators.comparison.greater_than greater than]]
|
[def __gt__ [link fusion.sequence.operator.comparison.greater_than greater than]]
|
||||||
[def __gte__ [link fusion.sequences.operators.comparison.greater_than_equal greater than equal]]
|
[def __gte__ [link fusion.sequence.operator.comparison.greater_than_equal greater than equal]]
|
||||||
|
|
||||||
[def __algorithm__ [link fusion.algorithms Algorithm]]
|
[def __algorithm__ [link fusion.algorithms Algorithm]]
|
||||||
[def __algorithms__ [link fusion.algorithms Algorithms]]
|
[def __algorithms__ [link fusion.algorithms Algorithms]]
|
||||||
@ -246,8 +246,8 @@
|
|||||||
[def __push_front__ [link fusion.algorithms.transformation.functions.push_front `push_front`]]
|
[def __push_front__ [link fusion.algorithms.transformation.functions.push_front `push_front`]]
|
||||||
[def __result_of_push_front__ [link fusion.algorithms.transformation.metafunctions.push_front `result_of::push_front`]]
|
[def __result_of_push_front__ [link fusion.algorithms.transformation.metafunctions.push_front `result_of::push_front`]]
|
||||||
|
|
||||||
[def __tr1_tuple_pair__ [link fusion.tuples.pairs `TR1 and std::pair`]]
|
[def __tr1_tuple_pair__ [link fusion.tuple.pairs `TR1 and std::pair`]]
|
||||||
[def __tuple_get__ [link fusion.tuples.class_template_tuple.element_access `get`]]
|
[def __tuple_get__ [link fusion.tuple.class_template_tuple.element_access `get`]]
|
||||||
|
|
||||||
[def __callable_obj__ [link fusion.functional.concepts.callable Callable Object]]
|
[def __callable_obj__ [link fusion.functional.concepts.callable Callable Object]]
|
||||||
[def __def_callable_obj__ [link fusion.functional.concepts.def_callable Deferred Callable Object]]
|
[def __def_callable_obj__ [link fusion.functional.concepts.def_callable Deferred Callable Object]]
|
||||||
@ -298,10 +298,13 @@
|
|||||||
[include quick_start.qbk]
|
[include quick_start.qbk]
|
||||||
[include organization.qbk]
|
[include organization.qbk]
|
||||||
[include support.qbk]
|
[include support.qbk]
|
||||||
[include iterators.qbk]
|
[include iterator.qbk]
|
||||||
[include sequences.qbk]
|
[include sequence.qbk]
|
||||||
|
[include container.qbk]
|
||||||
|
[include view.qbk]
|
||||||
|
[include adapted.qbk]
|
||||||
[include algorithms.qbk]
|
[include algorithms.qbk]
|
||||||
[include tuples.qbk]
|
[include tuple.qbk]
|
||||||
[include extension.qbk]
|
[include extension.qbk]
|
||||||
[include functional.qbk]
|
[include functional.qbk]
|
||||||
[include notes.qbk]
|
[include notes.qbk]
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[section Iterators]
|
[section Iterator]
|
||||||
|
|
||||||
Like __mpl__ and __stl__, iterators are a fundamental concept in Fusion.
|
Like __mpl__ and __stl__, iterators are a fundamental concept in Fusion.
|
||||||
As with __mpl__ and __stl__ iterators describe positions, and
|
As with __mpl__ and __stl__ iterators describe positions, and
|
||||||
provide access to data within an underlying __sequence__.
|
provide access to data within an underlying __sequence__.
|
||||||
|
|
||||||
[heading Header]
|
/iterator.hpp>
|
||||||
#include <boost/fusion/iterator.hpp>
|
|
||||||
|
|
||||||
[section Concepts]
|
[section Concepts]
|
||||||
|
|
||||||
@ -230,8 +230,7 @@ Deferences an iterator.
|
|||||||
|
|
||||||
[*Semantics]: Dereferences the iterator `i`.
|
[*Semantics]: Dereferences the iterator `i`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/deref.hpp>
|
||||||
#include <boost/fusion/iterator/deref.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int&> vec;
|
typedef __vector__<int,int&> vec;
|
||||||
@ -267,8 +266,7 @@ Moves an iterator 1 position forwards.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the next element after `i`.
|
[*Semantics]: Returns an iterator to the next element after `i`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/next.hpp>
|
||||||
#include <boost/fusion/iterator/next.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int,int> vec;
|
typedef __vector__<int,int,int> vec;
|
||||||
@ -303,8 +301,7 @@ Moves an iterator 1 position backwards.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the element prior to `i`.
|
[*Semantics]: Returns an iterator to the element prior to `i`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/prior.hpp>
|
||||||
#include <boost/fusion/iterator/prior.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int> vec;
|
typedef __vector__<int,int> vec;
|
||||||
@ -339,8 +336,7 @@ Returns the distance between 2 iterators.
|
|||||||
|
|
||||||
[*Semantics]: Returns the distance between iterators `i` and `j`.
|
[*Semantics]: Returns the distance between iterators `i` and `j`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/distance.hpp>
|
||||||
#include <boost/fusion/iterator/distance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int,int> vec;
|
typedef __vector__<int,int,int> vec;
|
||||||
@ -375,8 +371,7 @@ Moves an iterator by a specified distance.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the element `M` positions from `i`. If `i` is a __bidirectional_iterator__ then `M` may be negative.
|
[*Semantics]: Returns an iterator to the element `M` positions from `i`. If `i` is a __bidirectional_iterator__ then `M` may be negative.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/advance.hpp>
|
||||||
#include <boost/fusion/iterator/advance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int,int> vec;
|
typedef __vector__<int,int,int> vec;
|
||||||
@ -411,8 +406,7 @@ Moves an iterator by a specified distance.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the element `N` positions from `i`. If `i` is a __bidirectional_iterator__ then `N` may be negative.
|
[*Semantics]: Returns an iterator to the element `N` positions from `i`. If `i` is a __bidirectional_iterator__ then `N` may be negative.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/advance.hpp>
|
||||||
#include <boost/fusion/iterator/advance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int,int> vec;
|
typedef __vector__<int,int,int> vec;
|
||||||
@ -424,7 +418,8 @@ Moves an iterator by a specified distance.
|
|||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
[section Operators]
|
[section Operator]
|
||||||
|
|
||||||
Overloaded operators are provided to provide a more natural syntax for dereferencing iterators, and comparing them for equality.
|
Overloaded operators are provided to provide a more natural syntax for dereferencing iterators, and comparing them for equality.
|
||||||
|
|
||||||
[section:operator_unary_star Operator *]
|
[section:operator_unary_star Operator *]
|
||||||
@ -450,8 +445,7 @@ Dereferences an iterator.
|
|||||||
|
|
||||||
[*Semantics]: Equivalent to `__deref__(i)`.
|
[*Semantics]: Equivalent to `__deref__(i)`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/deref.hpp>
|
||||||
#include <boost/fusion/iterator/deref.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int&> vec;
|
typedef __vector__<int,int&> vec;
|
||||||
@ -488,8 +482,7 @@ Compares 2 iterators for equality.
|
|||||||
|
|
||||||
[*Semantics]: Equivalent to `__result_of_equal_to__<I,J>::value` where `I` and `J` are the types of `i` and `j` respectively.
|
[*Semantics]: Equivalent to `__result_of_equal_to__<I,J>::value` where `I` and `J` are the types of `i` and `j` respectively.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/equal_to.hpp>
|
||||||
#include <boost/fusion/iterator/equal_to.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@ -516,8 +509,7 @@ Compares 2 iterators for inequality.
|
|||||||
|
|
||||||
[*Semantics]: Equivalent to `!__result_of_equal_to__<I,J>::value` where `I` and `J` are the types of `i` and `j` respectively.
|
[*Semantics]: Equivalent to `!__result_of_equal_to__<I,J>::value` where `I` and `J` are the types of `i` and `j` respectively.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/equal_to.hpp>
|
||||||
#include <boost/fusion/iterator/equal_to.hpp>
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@ -552,8 +544,7 @@ Returns the type stored at the position of an iterator.
|
|||||||
|
|
||||||
[*Semantics]: Returns the type stored in a sequence at iterator position `I`.
|
[*Semantics]: Returns the type stored in a sequence at iterator position `I`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/value_of.hpp>
|
||||||
#include <boost/fusion/iterator/value_of.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int&,const int&> vec;
|
typedef __vector__<int,int&,const int&> vec;
|
||||||
@ -593,8 +584,7 @@ Returns the type that will be returned by dereferencing an iterator.
|
|||||||
|
|
||||||
[*Semantics]: Returns the result of dereferencing an iterator of type `I`.
|
[*Semantics]: Returns the result of dereferencing an iterator of type `I`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/deref.hpp>
|
||||||
#include <boost/fusion/iterator/deref.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,int&> vec;
|
typedef __vector__<int,int&> vec;
|
||||||
@ -636,8 +626,7 @@ Returns the type of the next iterator in a sequence.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the next element in the sequence after `I`.
|
[*Semantics]: Returns an iterator to the next element in the sequence after `I`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/next.hpp>
|
||||||
#include <boost/fusion/iterator/next.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double> vec;
|
typedef __vector__<int,double> vec;
|
||||||
@ -673,8 +662,7 @@ Returns the type of the previous iterator in a sequence.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator to the previous element in the sequence before `I`.
|
[*Semantics]: Returns an iterator to the previous element in the sequence before `I`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/prior.hpp>
|
||||||
#include <boost/fusion/iterator/prior.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double> vec;
|
typedef __vector__<int,double> vec;
|
||||||
@ -714,8 +702,7 @@ Returns a true-valued __mpl_integral_constant__ if `I` and `J` are equal.
|
|||||||
|
|
||||||
[*Semantics]: Returns `boost::mpl::true_` if `I` and `J` are iterators to the same position. Returns `boost::mpl::false_` otherwise.
|
[*Semantics]: Returns `boost::mpl::true_` if `I` and `J` are iterators to the same position. Returns `boost::mpl::false_` otherwise.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/equal_to.hpp>
|
||||||
#include <boost/fusion/iterator/equal_to.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double> vec;
|
typedef __vector__<int,double> vec;
|
||||||
@ -753,8 +740,7 @@ Returns the distance between two iterators.
|
|||||||
|
|
||||||
[*Semantics]: Returns the distance between iterators of types `I` and `J`.
|
[*Semantics]: Returns the distance between iterators of types `I` and `J`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/distance.hpp>
|
||||||
#include <boost/fusion/iterator/distance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double,char> vec;
|
typedef __vector__<int,double,char> vec;
|
||||||
@ -795,8 +781,7 @@ Moves an iterator a specified distance.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator a distance `M` from `I`. If `I` is a __bidirectional_iterator__ then `M` may be negative.
|
[*Semantics]: Returns an iterator a distance `M` from `I`. If `I` is a __bidirectional_iterator__ then `M` may be negative.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/advance.hpp>
|
||||||
#include <boost/fusion/iterator/advance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double,char> vec;
|
typedef __vector__<int,double,char> vec;
|
||||||
@ -836,8 +821,7 @@ Moves an iterator by a specified distance.
|
|||||||
|
|
||||||
[*Semantics]: Returns an iterator a distance `N` from `I`. If `I` is a __bidirectional_iterator__ then `N` may be negative. Equivalent to `__result_of_advance__<I, boost::mpl::int_<N> >::type`.
|
[*Semantics]: Returns an iterator a distance `N` from `I`. If `I` is a __bidirectional_iterator__ then `N` may be negative. Equivalent to `__result_of_advance__<I, boost::mpl::int_<N> >::type`.
|
||||||
|
|
||||||
[heading Header]
|
/iterator/advance.hpp>
|
||||||
#include <boost/fusion/iterator/advance.hpp>
|
|
||||||
|
|
||||||
[heading Example]
|
[heading Example]
|
||||||
typedef __vector__<int,double,char> vec;
|
typedef __vector__<int,double,char> vec;
|
@ -10,12 +10,19 @@ The library is organized in three layers:
|
|||||||
[:[$images/fusion_org.png]]
|
[:[$images/fusion_org.png]]
|
||||||
|
|
||||||
The entire library is found in the "boost/fusion" directory. Modules are
|
The entire library is found in the "boost/fusion" directory. Modules are
|
||||||
organized in directories. Each module has its own header file placed in the
|
organized in directories. Each module has its own header file placed in
|
||||||
same directory with the actual module-directory. For example, there exists
|
the same directory with the actual module-directory. For example, there
|
||||||
"boost/fusion/support.hpp" in the same directory as "boost/fusion/support".
|
exists "boost/fusion/support.hpp" in the same directory as
|
||||||
Everything, except those found inside "detail" directories, is public. The
|
"boost/fusion/support". Everything, except those found inside "detail"
|
||||||
library is header-only. There is no need to build object files to link
|
directories, is public.
|
||||||
against.
|
|
||||||
|
There is also a "boost/fusion/include/" directory that contains all the
|
||||||
|
headers to all the components and modules. If you are unsure where to
|
||||||
|
find a specific component or module, or don't want to fuss with
|
||||||
|
hierarchy and nesting, use this.
|
||||||
|
|
||||||
|
The library is header-only. There is no need to build object files to
|
||||||
|
link against.
|
||||||
|
|
||||||
[heading Directory]
|
[heading Directory]
|
||||||
|
|
||||||
@ -24,22 +31,13 @@ against.
|
|||||||
* iteration
|
* iteration
|
||||||
* query
|
* query
|
||||||
* transformation
|
* transformation
|
||||||
* sequence
|
|
||||||
* adapted
|
* adapted
|
||||||
* array
|
* array
|
||||||
* mpl
|
* mpl
|
||||||
|
* boost::tuple
|
||||||
* std_pair
|
* std_pair
|
||||||
* comparison
|
* struct
|
||||||
* container
|
* variant
|
||||||
* list
|
|
||||||
* map
|
|
||||||
* set
|
|
||||||
* vector
|
|
||||||
* conversion
|
|
||||||
* generation
|
|
||||||
* intrinsic
|
|
||||||
* io
|
|
||||||
* utility
|
|
||||||
* view
|
* view
|
||||||
* filter_view
|
* filter_view
|
||||||
* iterator_range
|
* iterator_range
|
||||||
@ -48,6 +46,20 @@ against.
|
|||||||
* single_view
|
* single_view
|
||||||
* transform_view
|
* transform_view
|
||||||
* zip_view
|
* zip_view
|
||||||
|
* container
|
||||||
|
* deque
|
||||||
|
* list
|
||||||
|
* map
|
||||||
|
* set
|
||||||
|
* vector
|
||||||
|
* mpl
|
||||||
|
* functional
|
||||||
|
* sequence
|
||||||
|
* comparison
|
||||||
|
* conversion
|
||||||
|
* intrinsic
|
||||||
|
* io
|
||||||
|
* utility
|
||||||
* iterator
|
* iterator
|
||||||
* support
|
* support
|
||||||
|
|
||||||
@ -56,13 +68,12 @@ against.
|
|||||||
If, for example, you want to use `list`, depending on the granularity that
|
If, for example, you want to use `list`, depending on the granularity that
|
||||||
you desire, you may do so by including one of
|
you desire, you may do so by including one of
|
||||||
|
|
||||||
#include <boost/fusion/sequence.hpp>
|
#include <boost/fusion/container.hpp>
|
||||||
#include <boost/fusion/sequence/container.hpp>
|
#include <boost/fusion/container/list.hpp>
|
||||||
#include <boost/fusion/sequence/container/list.hpp>
|
|
||||||
|
|
||||||
The first includes all sequences. The second includes all of sequence
|
The first includes all containers The second includes only `list`
|
||||||
containers. The third includes only `list` [footnote Modules may contain
|
[footnote Modules may contain smaller components. Header file
|
||||||
smaller components. Header file information for each component will be
|
information for each component will be provided as part of the
|
||||||
provided as part of the component's documentation.].
|
component's documentation.].
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
|||||||
[section Tuples]
|
[section Tuple]
|
||||||
|
|
||||||
The TR1 technical report describes extensions to the C++ standard library.
|
The TR1 technical report describes extensions to the C++ standard library.
|
||||||
Many of these extensions will be considered for the next
|
Many of these extensions will be considered for the next
|
||||||
iteration of the C++ standard. TR1 describes a tuple type, and
|
iteration of the C++ standard. TR1 describes a tuple type, and
|
||||||
@ -22,8 +23,7 @@ in future releases of fusion.
|
|||||||
typename TN = __unspecified__>
|
typename TN = __unspecified__>
|
||||||
class tuple;
|
class tuple;
|
||||||
|
|
||||||
[heading Header]
|
/tuple.hpp>
|
||||||
#include <boost/fusion/tuple.hpp>
|
|
||||||
|
|
||||||
[section Construction]
|
[section Construction]
|
||||||
|
|
461
doc/view.qbk
Normal file
461
doc/view.qbk
Normal file
@ -0,0 +1,461 @@
|
|||||||
|
[section View]
|
||||||
|
|
||||||
|
Views are sequences that do not actually contain data, but instead impart
|
||||||
|
an alternative presentation over the data from one or more underlying
|
||||||
|
sequences. Views are proxies. They provide an efficient yet purely
|
||||||
|
functional way to work on potentially expensive sequence operations. Views
|
||||||
|
are inherently lazy. Their elements are only computed on demand only when
|
||||||
|
the elements of the underlying sequence(s) are actually accessed. Views'
|
||||||
|
lazy nature make them very cheap to copy and be passed around by value.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view.hpp>
|
||||||
|
|
||||||
|
[section single_view]
|
||||||
|
|
||||||
|
`single_view` is a view into a value as a single element sequence.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/single_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct single_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`T`] [Any type] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`S`] [A `single_view` type]]
|
||||||
|
[[`s`, `s2`] [Instances of `single_view`]]
|
||||||
|
[[`x`] [An instance of `T`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __forward_sequence__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`S(x)`] [Creates a `single_view` from `x`.]]
|
||||||
|
[[`S(s)`] [Copy constructs a `single_view` from another `single_view`, `s`.]]
|
||||||
|
[[`s = s2`] [Assigns to a `single_view`, `s`, from another `single_view`, `s2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
single_view<int> view(3);
|
||||||
|
std::cout << view << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section filter_view]
|
||||||
|
|
||||||
|
[heading Description]
|
||||||
|
|
||||||
|
`filter_view` is a view into a subset of its underlying sequence's elements
|
||||||
|
satisfying a given predicate (an __mpl__ metafunction). The `filter_view`
|
||||||
|
presents only those elements for which its predicate evaluates to
|
||||||
|
`mpl::true_`.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/filter_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename Sequence, typename Pred>
|
||||||
|
struct filter_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`Sequence`] [A __forward_sequence__] []]
|
||||||
|
[[`Pred`] [Unary Metafunction
|
||||||
|
returning an `mpl::bool_`] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`F`] [A `filter_view` type]]
|
||||||
|
[[`f`, `f2`] [Instances of `filter_view`]]
|
||||||
|
[[`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__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`F(s)`] [Creates a `filter_view` given a sequence, `s`.]]
|
||||||
|
[[`F(f)`] [Copy constructs a `filter_view` from another `filter_view`, `f`.]]
|
||||||
|
[[`f = f2`] [Assigns to a `filter_view`, `f`, from another `filter_view`, `f2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
using boost::mpl::_;
|
||||||
|
using boost::mpl::not_;
|
||||||
|
using boost::is_class;
|
||||||
|
|
||||||
|
typedef __vector__<std::string, char, long, bool, double> vector_type;
|
||||||
|
|
||||||
|
vector_type v("a-string", '@', 987654, true, 6.6);
|
||||||
|
filter_view<vector_type const, not_<is_class<_> > > view(v);
|
||||||
|
std::cout << view << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section iterator_range]
|
||||||
|
|
||||||
|
[heading Description]
|
||||||
|
|
||||||
|
`iterator_range` presents a sub-range of its underlying sequence delimited
|
||||||
|
by a pair of iterators.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/iterator_range.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename First, typename Last>
|
||||||
|
struct iterator_range;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`First`] [A fusion __iterator__] []]
|
||||||
|
[[`Last`] [A fusion __iterator__] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__, __bidirectional_sequence__ or
|
||||||
|
__random_access_sequence__ depending on the traversal characteristics (see
|
||||||
|
__traversal_concept__) of its underlying sequence.
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`IR`] [An `iterator_range` type]]
|
||||||
|
[[`f`] [An instance of `First`]]
|
||||||
|
[[`l`] [An instance of `Last`]]
|
||||||
|
[[`ir`, `ir2`] [Instances of `iterator_range`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __forward_sequence__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`IR(f, l)`] [Creates an `iterator_range` given iterators, `f` and `l`.]]
|
||||||
|
[[`IR(ir)`] [Copy constructs an `iterator_range` from another `iterator_range`, `ir`.]]
|
||||||
|
[[`ir = ir2`] [Assigns to a `iterator_range`, `ir`, from another `iterator_range`, `ir2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
char const* s = "Ruby";
|
||||||
|
typedef __vector__<int, char, double, char const*> vector_type;
|
||||||
|
vector_type vec(1, 'x', 3.3, s);
|
||||||
|
|
||||||
|
typedef __result_of_begin__<vector_type>::type A;
|
||||||
|
typedef __result_of_end__<vector_type>::type B;
|
||||||
|
typedef __result_of_next__<A>::type C;
|
||||||
|
typedef __result_of_prior__<B>::type D;
|
||||||
|
|
||||||
|
C c(vec);
|
||||||
|
D d(vec);
|
||||||
|
|
||||||
|
iterator_range<C, D> range(c, d);
|
||||||
|
std::cout << range << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section joint_view]
|
||||||
|
|
||||||
|
[heading Description]
|
||||||
|
|
||||||
|
`joint_view` presents a view which is a concatenation of two sequences.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/joint_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename Sequence1, typename Sequence2>
|
||||||
|
struct joint_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`Sequence1`] [A __forward_sequence__] []]
|
||||||
|
[[`Sequence2`] [A __forward_sequence__] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`JV`] [A `joint_view` type]]
|
||||||
|
[[`s1`] [An instance of `Sequence1`]]
|
||||||
|
[[`s2`] [An instance of `Sequence2`]]
|
||||||
|
[[`jv`, `jv2`] [Instances of `joint_view`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __forward_sequence__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`JV(s1, s2)`] [Creates a `joint_view` given sequences, `s1` and `s2`.]]
|
||||||
|
[[`JV(jv)`] [Copy constructs a `joint_view` from another `joint_view`, `jv`.]]
|
||||||
|
[[`jv = jv2`] [Assigns to a `joint_view`, `jv`, from another `joint_view`, `jv2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
__vector__<int, char> v1(3, 'x');
|
||||||
|
__vector__<std::string, int> v2("hello", 123);
|
||||||
|
joint_view<
|
||||||
|
__vector__<int, char>
|
||||||
|
, __vector__<std::string, int>
|
||||||
|
> view(v1, v2);
|
||||||
|
std::cout << view << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section zip_view]
|
||||||
|
|
||||||
|
[heading Description]
|
||||||
|
|
||||||
|
`zip_view` presents a view which iterates over a collection of __sequence__s in parallel. A `zip_view`
|
||||||
|
is constructed from a __sequence__ of references to the component __sequence__s.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/zip_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename Sequences>
|
||||||
|
struct zip_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`Sequences`] [A __forward_sequence__ of references to other Fusion __sequence__s] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__, __bidirectional_sequence__ or
|
||||||
|
__random_access_sequence__ depending on the traversal characteristics (see
|
||||||
|
__traversal_concept__) of its underlying sequence.
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`ZV`] [A `joint_view` type]]
|
||||||
|
[[`s`] [An instance of `Sequences`]]
|
||||||
|
[[`zv1`, `zv2`] [Instances of `ZV`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __forward_sequence__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`ZV(s)`] [Creates a `zip_view` given a sequence of references to the component __sequence__s.]]
|
||||||
|
[[`ZV(zv1)`] [Copy constructs a `zip_view` from another `zip_view`, `zv`.]]
|
||||||
|
[[`zv1 = zv2`] [Assigns to a `zip_view`, `zv`, from another `zip_view`, `zv2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
typedef __vector__<int,int> vec1;
|
||||||
|
typedef __vector__<char,char> vec2;
|
||||||
|
vec1 v1(1,2);
|
||||||
|
vec2 v2('a','b');
|
||||||
|
typedef __vector__<vec1&, vec2&> sequences;
|
||||||
|
std::cout << zip_view<sequences>(sequences(v1, v2)) << std::endl; // ((1 a) (2 b))
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section transform_view]
|
||||||
|
|
||||||
|
The unary version of `transform_view` presents a view of its underlying
|
||||||
|
sequence given a unary function object or function pointer. The binary
|
||||||
|
version of `transform_view` presents a view of 2 underlying sequences,
|
||||||
|
given a binary function object or function pointer. The `transform_view`
|
||||||
|
inherits the traversal characteristics (see __traversal_concept__) of
|
||||||
|
its underlying sequence or sequences.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/transform_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
[*Unary Version]
|
||||||
|
|
||||||
|
template <typename Sequence, typename F1>
|
||||||
|
struct transform_view;
|
||||||
|
|
||||||
|
[*Binary Version]
|
||||||
|
|
||||||
|
template <typename Sequence1, typename Sequence2, typename F2>
|
||||||
|
struct transform_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`Sequence`] [A __forward_sequence__] []]
|
||||||
|
[[`Sequence1`] [A __forward_sequence__] []]
|
||||||
|
[[`Sequence2`] [A __forward_sequence__] []]
|
||||||
|
[[`F1`] [A unary function object or function pointer. `__boost_result_of_call__<F1(E)>::type` is the return type of an instance of `F1` when called with a value of each element type `E` in the input sequence.] []]
|
||||||
|
[[`F2`] [A binary function object or function pointer. `__boost_result_of_call__<F2(E1, E2)>::type` is the return type of an instance of `F2` when called with a value of each corresponding pair of element type `E1` and `E2` in the input sequences.] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __forward_sequence__, __bidirectional_sequence__ or
|
||||||
|
__random_access_sequence__ depending on the traversal characteristics (see
|
||||||
|
__traversal_concept__) of its underlying sequence.
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`TV`] [A `transform_view` type]]
|
||||||
|
[[`BTV`] [A binary `transform_view` type]]
|
||||||
|
[[`UTV`] [A unary `transform_view` type]]
|
||||||
|
[[`f1`] [An instance of `F1`]]
|
||||||
|
[[`f2`] [An instance of `F2`]]
|
||||||
|
[[`s`] [An instance of `Sequence`]]
|
||||||
|
[[`s1`] [An instance of `Sequence1`]]
|
||||||
|
[[`s2`] [An instance of `Sequence2`]]
|
||||||
|
[[`tv`, `tv2`] [Instances of `transform_view`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __forward_sequence__, __bidirectional_sequence__ or
|
||||||
|
__random_access_sequence__ depending on the traversal characteristics (see
|
||||||
|
__traversal_concept__) of its underlying sequence or sequences.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`UTV(s, f1)`] [Creates a unary `transform_view` given sequence,
|
||||||
|
`s` and unary function object or function pointer, `f1`.]]
|
||||||
|
[[`BTV(s1, s2, f2)`] [Creates a binary `transform_view` given sequences, `s1` and `s2`
|
||||||
|
and binary function object or function pointer, `f2`.]]
|
||||||
|
[[`TV(tv)`] [Copy constructs a `transform_view` from another `transform_view`, `tv`.]]
|
||||||
|
[[`tv = tv2`] [Assigns to a `transform_view`, `tv`, from another `transform_view`, `tv2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
struct square
|
||||||
|
{
|
||||||
|
template<typename Sig>
|
||||||
|
struct result;
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
struct result<square(U)>
|
||||||
|
: remove_reference<U>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
T operator()(T x) const
|
||||||
|
{
|
||||||
|
return x * x;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef __vector__<int, short, double> vector_type;
|
||||||
|
vector_type vec(2, 5, 3.3);
|
||||||
|
|
||||||
|
transform_view<vector_type, square> transform(vec, square());
|
||||||
|
std::cout << transform << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[section reverse_view]
|
||||||
|
|
||||||
|
`reverse_view` presents a reversed view of underlying sequence. The first
|
||||||
|
element will be its last and the last element will be its first.
|
||||||
|
|
||||||
|
[heading Header]
|
||||||
|
|
||||||
|
#include <boost/fusion/view/reverse_view.hpp>
|
||||||
|
|
||||||
|
[heading Synopsis]
|
||||||
|
|
||||||
|
template <typename Sequence>
|
||||||
|
struct reverse_view;
|
||||||
|
|
||||||
|
[heading Template parameters]
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Parameter] [Description] [Default]]
|
||||||
|
[[`Sequence`] [A __bidirectional_sequence__] []]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Model of]
|
||||||
|
|
||||||
|
* __bidirectional_sequence__
|
||||||
|
|
||||||
|
[variablelist Notation
|
||||||
|
[[`RV`] [A `reverse_view` type]]
|
||||||
|
[[`s`] [An instance of `Sequence`]]
|
||||||
|
[[`rv`, `rv2`] [Instances of `reverse_view`]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Expression Semantics]
|
||||||
|
|
||||||
|
Semantics of an expression is defined only where it differs from, or is not
|
||||||
|
defined in __bidirectional_sequence__.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Expression] [Semantics]]
|
||||||
|
[[`RV(s)`] [Creates a unary `reverse_view` given sequence, `s`.]]
|
||||||
|
[[`RV(rv)`] [Copy constructs a `reverse_view` from another `reverse_view`, `rv`.]]
|
||||||
|
[[`rv = rv2`] [Assigns to a `reverse_view`, `rv`, from another `reverse_view`, `rv2`.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading Example]
|
||||||
|
|
||||||
|
typedef __vector__<int, short, double> vector_type;
|
||||||
|
vector_type vec(2, 5, 3.3);
|
||||||
|
|
||||||
|
reverse_view<vector_type> reverse(vec);
|
||||||
|
std::cout << reverse << std::endl;
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[endsect]
|
Reference in New Issue
Block a user