From 586440e16ef53bee15453e0184bd9e1aaa961004 Mon Sep 17 00:00:00 2001
From: Tobias Schwinger
@@ -61,39 +61,39 @@
fusion algorithms are functional in nature such that algorithms are non mutating
(no side effects). However, due to the high cost of returning full sequences
such as vectors and lists, Views are returned from Fusion
- algorithms instead. For example, the transform algorithm does not actually
- return a transformed version of the original sequence. transform returns a transform_view. This view holds a
+ algorithms instead. For example, the
The lazy evaluation scheme where Algorithms
return Views also allows operations
- such as push_back to be totally generic. In
- Fusion, push_back is actually a generic algorithm
- that works on all sequences. Given an input sequence s
- and a value x, Fusion's push_back algorithm simply returns
- a joint_view:
- a view that holds a reference to the original sequence s
- and the value x. Functions
+ such as
- A type of function object with a nested metafunction result.
- result returns the result
+ A type of function object with a nested metafunction Notation
-
+
Lazy Evaluation
transform
algorithm does not actually
+ return a transformed version of the original sequence. transform
returns a transform_view
. This view holds a
reference to the original sequence plus the transform function. Iteration over
- the transform_view
+ the transform_view
will apply the transform function over the sequence elements on demand. This
lazy evaluation scheme allows us to chain as many algorithms
as we want without incurring a high runtime penalty.
-
+
Sequence Extension
push_back
to be totally generic. In
+ Fusion, push_back
is actually a generic algorithm
+ that works on all sequences. Given an input sequence s
+ and a value x
, Fusion's push_back
algorithm simply returns
+ a joint_view
:
+ a view that holds a reference to the original sequence s
+ and the value x
. Functions
that were once sequence specific and need to be implemented N times over N
different sequences are now implemented only once. That is to say that Fusion
sequences are cheaply extensible. However, an important caveat is that the
- result of a sequence extending operation like push_back does not retain the properties
+ result of a sequence extending operation like push_back
does not retain the properties
of the original sequence such as associativity of _set_s.
To regain the original sequence, Conversion
functions are provided. You may use one of the Conversion
functions to convert back to the original sequence type.
-
+
Header
diff --git a/doc/html/fusion/algorithms/concepts.html b/doc/html/fusion/algorithms/concepts.html
index f5fae0ac..5c7fa706 100644
--- a/doc/html/fusion/algorithms/concepts.html
+++ b/doc/html/fusion/algorithms/concepts.html
@@ -3,7 +3,7 @@
-
+
Description
result
.
+ result
returns the result
type of calling the function object, given the argument types.
-
F
f
T1
+ ...TN
t1
+ ...tN
T1 ...TN
-
+
Refinement
of
@@ -69,7 +69,7 @@
MPL Metafunction Class
f(t1, ...tN)
F::result<T1, ...TN>::type
diff --git a/doc/html/fusion/algorithms/iteration/functions.html b/doc/html/fusion/algorithms/iteration/functions.html index 782ff9c7..db876984 100644 --- a/doc/html/fusion/algorithms/iteration/functions.html +++ b/doc/html/fusion/algorithms/iteration/functions.html @@ -3,7 +3,7 @@Functions - + diff --git a/doc/html/fusion/algorithms/iteration/functions/accumulate.html b/doc/html/fusion/algorithms/iteration/functions/accumulate.html index 97c5bc9e..ac01f7bf 100644 --- a/doc/html/fusion/algorithms/iteration/functions/accumulate.html +++ b/doc/html/fusion/algorithms/iteration/functions/accumulate.html @@ -3,7 +3,7 @@accumulate - + @@ -26,18 +26,18 @@- + Description
Repeatedly applies binary Polymorphic - Function Object f - to each element of a sequence and the previous state. accumulate is equivalent to - fold. + Function Object
f
+ to each element of a sequence and the previous state.accumulate
is equivalent to +fold
.- + Synopsis
@@ -46,11 +46,11 @@ typename State, typename F > -typename result_of::accumulate<Sequence, State, F>::type accumulate( +typenameresult_of::accumulate
<Sequence, State, F>::type accumulate( Sequence& seq, State const& initial_state, F const& f);-Table 1.33. Parameters
+Table 1.33. Parameters
@@ -64,24 +64,24 @@ - seq +seq
A model of Forward - Sequence, f(eN ....f(e2,f(e1,initial_state))) must be a valid expression for - each element e1 to - eN in seq + Sequence, f(eN ....f(e2,f(e1,initial_state)))
must be a valid expression for + each elemente1
to +eN
inseq
Operation's argument - initial_state +initial_state
Any type Initial state - f +f
A model of binary Polymorphic @@ -93,7 +93,7 @@ - + Expression Semantics
@@ -101,28 +101,28 @@ accumulate(seq, initial_state, f);
- Return type: Any type + Return type: Any type
- Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state)))
- where e1 ...eN are the elements of seq.
+ Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state)))
+ where e1 ...eN
are the elements of seq
.
- Linear, exactly result_of::size<Sequence>::value applications of f.
+ Linear, exactly
applications of result_of::size
<Sequence>::valuef
.
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
@@ -141,8 +141,8 @@ } }; ... -const vector<int,int> vec(1,2); -assert(accumulate(vec,std::string(""), make_string()) == "12"); +constvector
<int,int> vec(1,2); +assert(accumulate
(vec,std::string(""), make_string()) == "12");
seq | +seq |
A
model of Forward
- Sequence,f(e) must be a valid expression for each
- element e in seq
+ Sequence,f(e) must be a valid expression for each
+ element e in seq
|
Operation's argument |
initial_state | +initial_state |
Any type | Initial state |
f | +f |
A model of binary Polymorphic @@ -91,7 +91,7 @@ |
- Return type: Any type + Return type: Any type
- Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state)))
- where e1 ...eN are the elements of seq.
+ Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state)))
+ where e1 ...eN
are the elements of seq
.
- Linear, exactly result_of::size<Sequence>::value applications of f.
+ Linear, exactly
applications of result_of::size
<Sequence>::valuef
.
#include <boost/fusion/algorithm/iteration/fold.hpp>
@@ -139,8 +139,8 @@ } }; ... -const vector<int,int> vec(1,2); -assert(fold(vec,std::string(""), make_string()) == "12"); +constvector
<int,int> vec(1,2); +assert(fold
(vec,std::string(""), make_string()) == "12");
seq | +seq |
A
model of Forward
- Sequence, f(e) must be a valid expression for each
- element e in seq
+ Sequence, f(e) must be a valid expression for each
+ element e in seq
|
Operation's argument |
f | +f |
A unary function object | Operation's argument | @@ -78,36 +78,36 @@
-for_each(seq, f);
+for_each
(seq, f);
- Return type: void
+ Return type: void
- Semantics: Calls f(e) for each element e
- in seq.
+ Semantics: Calls f(e)
for each element e
+ in seq
.
- Linear, exactly result_of::size<Sequence>::value applications of f.
+ Linear, exactly
applications of result_of::size
<Sequence>::valuef
.
#include <boost/fusion/algorithm/iteration/for_each.hpp>
@@ -120,9 +120,9 @@ } }; ... -vector<int,int> vec(1,2); -for_each(vec, increment()); -assert(vec == make_vector(2,3)); +vector
<int,int> vec(1,2); +for_each
(vec, increment()); +assert(vec ==make_vector
(2,3));
Sequence | +Sequence |
A model of Forward @@ -70,15 +70,15 @@ | The sequence to iterate |
State | +State |
Any type | The initial state for the first application of
- F
+ F
|
F | +F |
A model of binary Polymorphic @@ -91,34 +91,34 @@ |
-result_of::accumulate<Sequence, State, F>::type
+result_of::accumulate
<Sequence, State, F>::type
- Return type: Any type + Return type: Any type
- Semantics: Returns the result of applying
- accumulate to a sequence
- of type Sequence, with
- an initial state of type State
+ Semantics: Returns the result of applying
+ accumulate
to a sequence
+ of type Sequence
, with
+ an initial state of type State
and binary Polymorphic
- Function Object of type F.
+ Function Object of type F
.
- Linear, exactly result_of::size<Sequence>::value applications of F.
+ Linear, exactly
applications of result_of::size
<Sequence>::valueF
.
diff --git a/doc/html/fusion/algorithms/iteration/metafunctions/fold.html b/doc/html/fusion/algorithms/iteration/metafunctions/fold.html index 5f99bbe2..7fc8eb99 100644 --- a/doc/html/fusion/algorithms/iteration/metafunctions/fold.html +++ b/doc/html/fusion/algorithms/iteration/metafunctions/fold.html @@ -3,7 +3,7 @@fold - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of fold. + Returns the result type of
fold
.- + Synopsis
@@ -47,7 +47,7 @@ };
-Table 1.35. Parameters
+Table 1.35. Parameters
@@ -61,7 +61,7 @@ - Sequence +Sequence
A model of Forward @@ -70,15 +70,15 @@ The sequence to iterate - State +State
Any type The initial state for the first application of - F + F
- F +F
A model of binary Polymorphic @@ -91,34 +91,34 @@ - + Expression Semantics
-result_of::fold<Sequence, State, F>::type +result_of::fold
<Sequence, State, F>::type- Return type: Any type + Return type: Any type
- Semantics: Returns the result of applying - fold to a sequence of - type Sequence, with an - initial state of type State + Semantics: Returns the result of applying +
fold
to a sequence of + typeSequence
, with an + initial state of typeState
and binary Polymorphic - Function Object of type F. + Function Object of typeF
.- + Complexity
- Linear, exactly result_of::size<Sequence>::value applications of F. + Linear, exactly
applications of
result_of::size
<Sequence>::valueF
.- + Header
diff --git a/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html b/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html index 67b0f947..6c18dfa8 100644 --- a/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html +++ b/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html @@ -3,7 +3,7 @@for_each - + @@ -26,15 +26,15 @@- A metafunction returning the result type of applying for_each to a sequence. The - return type of for_each is always void. + A metafunction returning the result type of applying
for_each
to a sequence. The + return type offor_each
is alwaysvoid
.- + Description
- + Synopsis
@@ -48,7 +48,7 @@ };
-Table 1.37. Parameters
+Table 1.37. Parameters
@@ -62,7 +62,7 @@ - Sequence +Sequence
A model of Forward @@ -71,7 +71,7 @@ Operation's argument - F +F
Any type Operation's argument @@ -80,32 +80,32 @@- + Expression Semantics
-result_of::for_each<Sequence, F>::type +result_of::for_each
<Sequence, F>::type- Return type: void. + Return type:
void
.- Semantics: Returns the return type of - for_each for a sequence of type - Sequence and a unary - function object F. The - return type is always void. + Semantics: Returns the return type of +
for_each
for a sequence of type +Sequence
and a unary + function objectF
. The + return type is alwaysvoid
.- + Complexity
Constant.
- + Header
diff --git a/doc/html/fusion/algorithms/query.html b/doc/html/fusion/algorithms/query.html index e8c47055..50b675e5 100644 --- a/doc/html/fusion/algorithms/query.html +++ b/doc/html/fusion/algorithms/query.html @@ -3,7 +3,7 @@Query - + @@ -29,7 +29,7 @@ The query algorithms provide support for searching and analyzing sequences.- + Header
diff --git a/doc/html/fusion/algorithms/query/functions.html b/doc/html/fusion/algorithms/query/functions.html index f06fb915..d078caff 100644 --- a/doc/html/fusion/algorithms/query/functions.html +++ b/doc/html/fusion/algorithms/query/functions.html @@ -3,7 +3,7 @@Functions - + diff --git a/doc/html/fusion/algorithms/query/functions/all.html b/doc/html/fusion/algorithms/query/functions/all.html index 9a6ccdb5..0b6790f5 100644 --- a/doc/html/fusion/algorithms/query/functions/all.html +++ b/doc/html/fusion/algorithms/query/functions/all.html @@ -3,7 +3,7 @@all - + @@ -26,18 +26,18 @@- + Description
- For a sequence seq and - unary function object f, - all returns true if - f returns true for every - element of seq. + For a sequence
seq
and + unary function objectf
, +all
returns true if +f
returns true for every + element ofseq
.- + Synopsis
@@ -45,11 +45,11 @@ typename Sequence, typename F > -typename result_of::all<Sequence,F>::type all( +typenameresult_of::all
<Sequence,F>::type all( Sequence const& seq, F f);-Table 1.39. Parameters
+Table 1.39. Parameters
@@ -63,19 +63,19 @@ - seq +seq
A model of Forward - Sequence, f(e) is a valid expression, convertible - to bool, for every element - e in seq + Sequence, f(e)
is a valid expression, convertible + tobool
, for every element +e
inseq
The sequence to search - f +f
A unary function object The search predicate @@ -84,38 +84,38 @@- + Expression Semantics
-all(seq, f); +all
(seq, f);- Return type: bool + Return type:
bool
- Semantics: Returns true if and only - if f(e) - evaluates to true for every - element e in seq. + Semantics: Returns true if and only + if
f(e)
+ evaluates totrue
for every + elemente
inseq
.- + Complexity
- Linear. At most result_of::size<Sequence>::value comparisons. + Linear. At most
comparisons.
result_of::size
<Sequence>::value- + Header
#include <boost/fusion/algorithm/query/all.hpp>- + Example
@@ -128,8 +128,8 @@ } }; ... -assert(all(make_vector(1,3), odd())); -assert(!all(make_vector(1,2), odd())); +assert(all
(make_vector
(1,3), odd())); +assert(!all
(make_vector
(1,2), odd()));
seq | +seq |
A
model of Forward
- Sequence, f(e) must be a valid expression, convertible
- to bool, for each element
- e in seq
+ Sequence, f(e) must be a valid expression, convertible
+ to bool , for each element
+ e in seq
|
The sequence to search |
f | +f |
A unary function object | The search predicate | @@ -84,38 +84,38 @@
-any(seq, f);
+any
(seq, f);
- Return type: bool
+ Return type: bool
- Semantics: Returns true if and only
- if f(e)
- evaluates to true for some
- element e in seq.
+ Semantics: Returns true if and only
+ if f(e)
+ evaluates to true
for some
+ element e
in seq
.
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/any.hpp>
@@ -128,8 +128,8 @@ } }; ... -assert(any(make_vector(1,2), odd())); -assert(!any(make_vector(2,4), odd())); +assert(any
(make_vector
(1,2), odd())); +assert(!any
(make_vector
(2,4), odd()));
seq | +seq |
A
model of Forward
- Sequence, e == t
- must be a valid expression, convertible to bool,
- for each element e
- in seq
+ Sequence, e == t
+ must be a valid expression, convertible to bool ,
+ for each element e
+ in seq
|
The sequence to search |
T | +T |
Any type | The type to count | @@ -81,42 +81,42 @@
-count(seq, t);
+count
(seq, t);
- Return type: int
+ Return type: int
- Semantics: Returns the number of elements
- of type T and equal to
- t in seq.
+ Semantics: Returns the number of elements
+ of type T
and equal to
+ t
in seq
.
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/count.hpp>
-const vector<double,int,int> vec(1.0,2,3); -assert(count(vec,2) == 1); +constvector
<double,int,int> vec(1.0,2,3); +assert(count
(vec,2) == 1);
seq | +seq |
A
model of Forward
- Sequence, f(e) is a valid expression, convertible
- to bool, for each element
- e in seq
+ Sequence, f(e) is a valid expression, convertible
+ to bool , for each element
+ e in seq
|
The sequence to search |
f | +f |
A unary function object | The search predicate | @@ -81,41 +81,41 @@
-count_if(seq, f)
+count_if
(seq, f)
- Return type: int
+ Return type: int
- Semantics: Returns the number of elements
- in seq where f evaluates to true.
+ Semantics: Returns the number of elements
+ in seq
where f
evaluates to true
.
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/count_if.hpp>
-const vector<int,int,int> vec(1,2,3); -assert(count_if(vec,odd()) == 2); +constvector
<int,int,int> vec(1,2,3); +assert(count_if
(vec,odd()) == 2);
seq | +seq |
A model of Forward @@ -73,7 +73,7 @@ | The sequence to search |
T | +T |
Any type | The type to search for | @@ -82,45 +82,45 @@
-find<T>(seq)
+find
<T>(seq)
- Return type: A model of the same iterator
- category as the iterators of seq.
+ Return type: A model of the same iterator
+ category as the iterators of seq
.
- Semantics: Returns an iterator to the
- first element of seq
- of type T, or end(seq) if there is no such element. Equivalent
- to find_if<boost::is_same<_, T> >(seq)
+ Semantics: Returns an iterator to the
+ first element of seq
+ of type T
, or
if there is no such element. Equivalent
+ to end
(seq)find_if
<boost::is_same<_, T> >(seq)
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/find.hpp>
-const vector<char,int> vec('a','0'); -assert(*find<int>(vec) == '0'); -assert(find<double>(vec) == end(vec)); +constvector
<char,int> vec('a','0'); +assert(*find
<int>(vec) == '0'); +assert(find
<double>(vec) ==end
(vec));
seq | +seq |
A model of Forward @@ -74,7 +74,7 @@ | The sequence to search |
F | +F |
A unary MPL Lambda Expression | The search predicate | @@ -83,46 +83,46 @@
-find_if<F>(seq)
+find_if
<F>(seq)
- Return type: An iterator of the same
- iterator category as the iterators of seq.
+ Return type: An iterator of the same
+ iterator category as the iterators of seq
.
- Semantics: Returns the first element
- of seq for which MPL
- Lambda Expression F evaluates
- to boost::mpl::true_, or end(seq)
+ Semantics: Returns the first element
+ of seq
for which MPL
+ Lambda Expression F
evaluates
+ to boost::mpl::true_
, or
if there is no such element.
end
(seq)
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/find_if.hpp>
-const vector<double,int> vec(1.0,2); -assert(*find_if<is_integral<mpl::_> >(vec) == 2); -assert(find_if<is_class<mpl::_> >(vec) == end(vec)); +constvector
<double,int> vec(1.0,2); +assert(*find_if
<is_integral<mpl::_> >(vec) == 2); +assert(find_if
<is_class<mpl::_> >(vec) ==end
(vec));
seq | +seq |
A
model of Forward
- Sequence, f(e) is a valid expression, convertible
- to bool, for every element
- e in seq
+ Sequence, f(e) is a valid expression, convertible
+ to bool , for every element
+ e in seq
|
The sequence to search |
f | +f |
A unary function object | The search predicate | @@ -84,38 +84,38 @@
-none(seq, f);
+none
(seq, f);
- Return type: bool
+ Return type: bool
- Semantics: Returns true if and only
- if f(e)
- evaluates to false for every
- element e in seq. Result equivalent to !any(seq, f).
+ Semantics: Returns true if and only
+ if f(e)
+ evaluates to false
for every
+ element e
in seq
. Result equivalent to !any(seq, f)
.
- Linear. At most result_of::size<Sequence>::value comparisons.
+ Linear. At most
comparisons.
result_of::size
<Sequence>::value
#include <boost/fusion/algorithm/query/none.hpp>
@@ -128,8 +128,8 @@ } }; ... -assert(none(make_vector(2,4), odd())); -assert(!none(make_vector(1,2), odd())); +assert(none
(make_vector
(2,4), odd())); +assert(!none
(make_vector
(1,2), odd()));
Sequence | +Sequence |
A model of Forward @@ -70,7 +70,7 @@ | Operation's argument |
F | +F |
A model of unary Polymorphic @@ -82,34 +82,34 @@ |
-result_of::all<Sequence, F>::type
+result_of::all
<Sequence, F>::type
- Return type: bool.
+ Return type: bool
.
- Semantics: Returns the return type of
- all
- given a sequence of type Sequence
+ Semantics: Returns the return type of
+ all
+ given a sequence of type Sequence
and a unary Polymorphic
- Function Object of type F.
- The return type is always bool.
+ Function Object of type F
.
+ The return type is always bool
.
Constant.
diff --git a/doc/html/fusion/algorithms/query/metafunctions/any.html b/doc/html/fusion/algorithms/query/metafunctions/any.html index b0de23a9..d72d800d 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/any.html +++ b/doc/html/fusion/algorithms/query/metafunctions/any.html @@ -3,7 +3,7 @@any - + @@ -26,14 +26,14 @@- + Description
- A metafunction returning the result type of any. + A metafunction returning the result type of
any
.- + Synopsis
@@ -47,7 +47,7 @@ };
-Table 1.45. Parameters
+Table 1.45. Parameters
@@ -61,7 +61,7 @@ - Sequence +Sequence
A model of Forward @@ -70,7 +70,7 @@ Operation's argument - F +F
A model of unary Polymorphic @@ -82,34 +82,34 @@ - + Expression Semantics
-result_of::any<Sequence, F>::type +result_of::any
<Sequence, F>::type- Return type: bool. + Return type:
bool
.- Semantics: Returns the return type of - any - given a sequence of type Sequence + Semantics: Returns the return type of +
any
+ given a sequence of typeSequence
and a unary Polymorphic - Function Object of type F. - The return type is always bool. + Function Object of typeF
. + The return type is alwaysbool
.- + Complexity
Constant.
- + Header
diff --git a/doc/html/fusion/algorithms/query/metafunctions/count.html b/doc/html/fusion/algorithms/query/metafunctions/count.html index bde12281..2dc89381 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/count.html +++ b/doc/html/fusion/algorithms/query/metafunctions/count.html @@ -3,7 +3,7 @@count - + @@ -26,15 +26,15 @@- + Description
- A metafunction that returns the result type of count + A metafunction that returns the result type of
count
given the sequence and search types.- + Synopsis
@@ -48,7 +48,7 @@ };
-Table 1.50. Parameters
+Table 1.50. Parameters
@@ -63,7 +63,7 @@ - Sequence +Sequence
A model of Forward @@ -72,7 +72,7 @@ Operation's argument - T +T
Any type Operation's argument @@ -81,30 +81,30 @@- + Expression Semantics
-result_of::count<T>::type +result_of::count
<T>::type- Return type: int. + Return type:
int
.- Semantics: Returns the return type of - count. The return type is always - int. + Semantics: Returns the return type of +
count
. The return type is always +int
.- + Complexity
Constant.
- + Header
diff --git a/doc/html/fusion/algorithms/query/metafunctions/count_if.html b/doc/html/fusion/algorithms/query/metafunctions/count_if.html index 3e8180f5..2d5aea46 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/count_if.html +++ b/doc/html/fusion/algorithms/query/metafunctions/count_if.html @@ -3,7 +3,7 @@count_if - + @@ -26,15 +26,15 @@- + Description
- A metafunction that returns the result type of count_if + A metafunction that returns the result type of
count_if
given the sequence and predicate types.- + Synopsis
@@ -48,7 +48,7 @@ };
-Table 1.51. Parameters
+Table 1.51. Parameters
@@ -62,7 +62,7 @@ - Sequence +Sequence
A model of Forward @@ -71,7 +71,7 @@ Operation's argument - Pred +Pred
A unary function object Operation's argument @@ -80,30 +80,30 @@- + Expression Semantics
-result_of::count_if<Sequence, Pred>::type +result_of::count_if
<Sequence, Pred>::type- Return type: int. + Return type:
int
.- Semantics: Returns the return type of - count_if. The return type is - always int. + Semantics: Returns the return type of +
count_if
. The return type is + alwaysint
.- + Complexity
Constant.
- + Header
diff --git a/doc/html/fusion/algorithms/query/metafunctions/find.html b/doc/html/fusion/algorithms/query/metafunctions/find.html index f75b8d2d..a30c2f8e 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/find.html +++ b/doc/html/fusion/algorithms/query/metafunctions/find.html @@ -3,7 +3,7 @@find - + @@ -26,15 +26,15 @@- + Description
- Returns the result type of find, + Returns the result type of
find
, given the sequence and search types.- + Synopsis
@@ -48,7 +48,7 @@ };
-Table 1.48. Parameters
+Table 1.48. Parameters
@@ -62,7 +62,7 @@ - Sequence +Sequence
Model of Forward @@ -71,7 +71,7 @@ Operation's argument - T +T
Any type Operation's argument @@ -80,31 +80,31 @@- + Expression Semantics
-result_of::find<Sequence, T>::type +result_of::find
<Sequence, T>::type- Return type: A model of the same iterator - category as the iterators of Sequence. + Return type: A model of the same iterator + category as the iterators of
Sequence
.- Semantics: Returns an iterator to the - first element of type T - in Sequence, or result_of::end<Sequence>::type if there is no such element. + Semantics: Returns an iterator to the + first element of type
T
+ inSequence
, orif there is no such element.
result_of::end
<Sequence>::type- + Complexity
- Linear, at most result_of::size<Sequence>::value comparisons. + Linear, at most
comparisons.
result_of::size
<Sequence>::value- + Header
diff --git a/doc/html/fusion/algorithms/query/metafunctions/find_if.html b/doc/html/fusion/algorithms/query/metafunctions/find_if.html index 19143c34..a063defa 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/find_if.html +++ b/doc/html/fusion/algorithms/query/metafunctions/find_if.html @@ -3,7 +3,7 @@find_if - + @@ -26,15 +26,15 @@- + Description
- Returns the result type of find_if + Returns the result type of
find_if
given the sequence and predicate types.- + Synopsis
@@ -48,7 +48,7 @@ };
-Table 1.49. Parameters
+Table 1.49. Parameters
@@ -62,7 +62,7 @@ - Sequence +Sequence
A model of Forward @@ -71,7 +71,7 @@ Operation's argument - Pred +Pred
A model of MPL Lambda Expression Operation's arguments @@ -80,32 +80,32 @@- + Expression Semantics
-result_of::find_if<Sequence, Pred>::type +result_of::find_if
<Sequence, Pred>::type- Return type: A model of the same iterator - category as the iterators of Sequence. + Return type: A model of the same iterator + category as the iterators of
Sequence
.- Semantics: Returns an iterator to the - first element in Sequence - for which Pred evaluates - to true. Returns result_of::end<Sequence>::type if there is no such element. + Semantics: Returns an iterator to the + first element in
Sequence
+ for whichPred
evaluates + to true. Returnsif there is no such element.
result_of::end
<Sequence>::type- + Complexity
- Linear. At most result_of::size<Sequence>::value comparisons. + Linear. At most
comparisons.
result_of::size
<Sequence>::value- + Header
diff --git a/doc/html/fusion/algorithms/query/metafunctions/none.html b/doc/html/fusion/algorithms/query/metafunctions/none.html index 40c2f431..05d9cd69 100644 --- a/doc/html/fusion/algorithms/query/metafunctions/none.html +++ b/doc/html/fusion/algorithms/query/metafunctions/none.html @@ -3,7 +3,7 @@none - + @@ -26,14 +26,14 @@- + Description
- A metafunction returning the result type of none. + A metafunction returning the result type of
none
.- + Synopsis
@@ -47,7 +47,7 @@ };
-Table 1.47. Parameters
+Table 1.47. Parameters
@@ -61,7 +61,7 @@ - Sequence +Sequence
A model of Forward @@ -70,7 +70,7 @@ Operation's argument - F +F
A model of unary Polymorphic @@ -82,34 +82,34 @@ - + Expression Semantics
-result_of::none<Sequence, F>::type +result_of::none
<Sequence, F>::type- Return type: bool. + Return type:
bool
.- Semantics: Returns the return type of - none given a sequence of type - Sequence and a unary + Semantics: Returns the return type of +
none
given a sequence of type +Sequence
and a unary Polymorphic Function - Object of type F. - The return type is always bool. + Object of typeF
. + The return type is alwaysbool
.- + Complexity
Constant.
- + Header
diff --git a/doc/html/fusion/algorithms/transformation.html b/doc/html/fusion/algorithms/transformation.html index 2c166c81..4b0a2eec 100644 --- a/doc/html/fusion/algorithms/transformation.html +++ b/doc/html/fusion/algorithms/transformation.html @@ -3,7 +3,7 @@Transformation - + @@ -35,14 +35,14 @@Note
+
As the transformation algorithms return views onto their input arguments, it is important that the lifetime of the input arguments is greater than the period during which you wish to use the results.
diff --git a/doc/html/fusion/algorithms/transformation/functions.html b/doc/html/fusion/algorithms/transformation/functions.html index 92367af0..5b87440b 100644 --- a/doc/html/fusion/algorithms/transformation/functions.html +++ b/doc/html/fusion/algorithms/transformation/functions.html @@ -3,7 +3,7 @@Functions - + diff --git a/doc/html/fusion/algorithms/transformation/functions/clear.html b/doc/html/fusion/algorithms/transformation/functions/clear.html index 4ac56bf1..4b1ef20a 100644 --- a/doc/html/fusion/algorithms/transformation/functions/clear.html +++ b/doc/html/fusion/algorithms/transformation/functions/clear.html @@ -3,7 +3,7 @@clear - + @@ -26,24 +26,24 @@- + Description
- clear returns an empty sequence. +
clear
returns an empty sequence.- + Synposis
template< typename Sequence > -typename result_of::clear<Sequence const>::type clear(Sequence const& seq); +typenameresult_of::clear
<Sequence const>::type clear(Sequence const& seq);-Table 1.61. Parameters
+Table 1.61. Parameters
@@ -56,7 +56,7 @@ Description - seq +seq
A model of Forward @@ -67,42 +67,42 @@ - + Expression Semantics
-clear(seq); +clear
(seq);- Return type: A model of Return type: A model of Forward Sequence.
- Expression Semantics: Returns a sequence + Expression Semantics: Returns a sequence with no elements.
- + Complexity
Constant.
- + Header
#include <boost/fusion/algorithm/transformation/clear.hpp>- + Example
-assert(clear(make_vector(1,2,3)) == make_vector()); +assert(clear
(make_vector
(1,2,3)) ==make_vector
());
seq | +seq |
A model of Forward @@ -77,82 +77,82 @@ | Operation's argument | |
it1 | +it1 |
A model of Forward Iterator | -Iterator into seq + | Iterator into seq
|
it2 | +it2 |
A model of Forward Iterator | -Iterator into seq - after it1 + | Iterator into seq
+ after it1
|
-erase(seq, pos);
+erase
(seq, pos);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq
- except the element at pos.
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
+ except the element at pos
.
-erase(seq, first, last);
+erase
(seq, first, last);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, with
- all the elements of seq,
- in their original order, except those in the range [first,last).
+ Semantics: Returns a new sequence, with
+ all the elements of seq
,
+ in their original order, except those in the range [first
,last
).
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/erase.hpp>
-const vector<int, double, char> vec(1, 2.0, 'c'); -assert(erase(vec, next(begin(vec))) == make_vector(1, 'c')); -assert(erase(vec, next(begin(vec)), end(vec)) == make_vector(1)); +constvector
<int, double, char> vec(1, 2.0, 'c'); +assert(erase
(vec,next
(begin
(vec))) ==make_vector
(1, 'c')); +assert(erase
(vec,next
(begin
(vec)),end
(vec)) ==make_vector
(1));
seq | +seq |
A model of Associative @@ -73,7 +73,7 @@ | Operation's argument |
Key | +Key |
Any type | Key to erase | @@ -82,43 +82,43 @@
-erase_key<Key>(seq);
+erase_key
<Key>(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
- except those with key Key.
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
+ except those with key Key
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
-assert(erase_key<int>(make_map<int, long>('a', 'b')) == make_map<long>('b')); +assert(erase_key
<int>(make_map
<int, long>('a', 'b')) ==make_map
<long>('b'));
seq | +seq |
A model of Forward @@ -68,7 +68,7 @@ | Operation's argument |
T | +T |
Any type | The type to retain | @@ -77,45 +77,45 @@
-filter<T>(seq);
+filter
<T>(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a sequence containing
- all the elements of seq
- of type T. Equivalent
- to filter_if<boost::same_type<_, T> >(seq).
+ Semantics: Returns a sequence containing
+ all the elements of seq
+ of type T
. Equivalent
+ to
.
filter_if
<boost::same_type<_, T> >(seq)
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/filter.hpp>
-const vector<int,int,long,long> vec(1,2,3,4); -assert(filter<int>(vec) == make_vector(1,2)); +constvector
<int,int,long,long> vec(1,2,3,4); +assert(filter
<int>(vec) ==make_vector
(1,2));
seq | +seq |
A model of Forward @@ -69,7 +69,7 @@ | Operation's argument |
Pred | +Pred |
A unary MPL Lambda Expression | The predicate to filter @@ -79,46 +79,46 @@ |
-filter_if<Pred>(seq);
+filter_if
<Pred>(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a sequence containing
- all the elements of seq
- with types for which Pred
- evaluates to boost::mpl::true_. The order of the retained elements
+ Semantics: Returns a sequence containing
+ all the elements of seq
+ with types for which Pred
+ evaluates to boost::mpl::true_
. The order of the retained elements
is the same as in the original sequence.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
-const vector<int,int,double,double> vec(1,2,3.0,4.0); -assert(filter_if<is_integral<mpl::_> >(vec) == make_vector(1,2)); +constvector
<int,int,double,double> vec(1,2,3.0,4.0); +assert(filter_if
<is_integral<mpl::_> >(vec) ==make_vector
(1,2));
seq | +seq |
A model of Forward @@ -69,7 +69,7 @@ | Operation's argument |
pos | +pos |
A model of Forward @@ -78,7 +78,7 @@ | The position to insert at |
t | +t |
Any type | The value to insert | @@ -87,46 +87,46 @@
-insert(seq, p, t);
+insert
(seq, p, t);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
in their original order, and a new element with the type and value of
- t inserted at iterator
- pos.
+ t
inserted at iterator
+ pos
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/insert.hpp>
-const vector<int,int> vec(1,2); -assert(insert(vec, next(begin(vec)), 3) == make_vector(1,3,2)); +constvector
<int,int> vec(1,2); +assert(insert
(vec,next
(begin
(vec)), 3) ==make_vector
(1,3,2));
seq | +seq |
A model of Forward @@ -70,7 +70,7 @@ | Operation's argument |
pos | +pos |
A model of Forward @@ -79,7 +79,7 @@ | The position to insert at |
range | +range |
A model of Forward @@ -91,46 +91,46 @@ |
-insert(seq, pos, range);
+insert
(seq, pos, range);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
- and the elements of range
- inserted at iterator pos.
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
+ and the elements of range
+ inserted at iterator pos
.
All elements retaining their ordering from the orignal sequences.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/insert_range.hpp>
-const vector<int,int> vec(1,2); -assert(insert_range(vec, next(begin(vec)), make_vector(3,4)) == make_vector(1,3,4,2)); +constvector
<int,int> vec(1,2); +assert(insert_range
(vec,next
(begin
(vec)),make_vector
(3,4)) ==make_vector
(1,3,4,2));
lhs | +lhs |
A model of Forward @@ -67,7 +67,7 @@ | Operation's argument |
rhs | +rhs |
A model of Forward @@ -79,46 +79,46 @@ |
-join(lhs, rhs);
+join
(lhs, rhs);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a sequence containing
- all the elements of lhs
- followed by all the elements of rhs.
+ Semantics: Returns a sequence containing
+ all the elements of lhs
+ followed by all the elements of rhs
.
The order of th elements is preserved.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/join.hpp>
-vector<int,char> v1(1, 'a'); -vector<int,char> v2(2, 'b'); -assert(join(v1, v2) == make_vector(1,'a',2,'b')); +vector
<int,char> v1(1, 'a'); +vector
<int,char> v2(2, 'b'); +assert(join
(v1, v2) ==make_vector
(1,'a',2,'b'));
Description | ||
---|---|---|
seq | +seq |
A model of Forward @@ -67,44 +67,44 @@ |
-pop_back(seq);
+pop_back
(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence containing
- all the elements of seq,
+ Semantics: Returns a new sequence containing
+ all the elements of seq
,
except the last element. The elements in the new sequence are in the
- same order as they were in seq.
+ same order as they were in seq
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/pop_back.hpp>
-assert(___pop_back__(make_vector(1,2,3)) == make_vector(1,2)); +assert(___pop_back__(make_vector
(1,2,3)) ==make_vector
(1,2));
Description | ||
---|---|---|
seq | +seq |
A model of Forward @@ -67,44 +67,44 @@ |
-pop_front(seq);
+pop_front
(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence containing
- all the elements of seq,
+ Semantics: Returns a new sequence containing
+ all the elements of seq
,
except the first element. The elements in the new sequence are in the
- same order as they were in seq.
+ same order as they were in seq
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/pop_front.hpp>
-assert(pop_front(make_vector(1,2,3)) == make_vector(2,3)); +assert(pop_front
(make_vector
(1,2,3)) ==make_vector
(2,3));
seq | +seq |
A model of Forward @@ -68,7 +68,7 @@ | Operation's argument |
t | +t |
Any type | The value to add to the end | @@ -77,44 +77,44 @@
-push_back(seq, t);
+push_back
(seq, t);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
- and new element t appended
- to the end. The elements are in the same order as they were in seq.
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
+ and new element t
appended
+ to the end. The elements are in the same order as they were in seq
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/push_back.hpp>
-assert(push_back(make_vector(1,2,3),4) == make_vector(1,2,3,4)); +assert(push_back
(make_vector
(1,2,3),4) ==make_vector
(1,2,3,4));
seq | +seq |
A model of Forward @@ -68,7 +68,7 @@ | Operation's argument |
t | +t |
Any type | The value to add to the beginning | @@ -77,45 +77,45 @@
-push_back(seq, t);
+push_back
(seq, t);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
- and new element t appended
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
+ and new element t
appended
to the beginning. The elements are in the same order as they were in
- seq.
+ seq
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/push_front.hpp>
-assert(push_front(make_vector(1,2,3),0) == make_vector(0,1,2,3)); +assert(push_front
(make_vector
(1,2,3),0) ==make_vector
(0,1,2,3));
seq | +seq |
A model of Forward @@ -68,7 +68,7 @@ | Operation's argument |
T | +T |
Any type | Type to remove | @@ -77,45 +77,45 @@
-remove<T>(seq);
+remove
<T>(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
- in their original order, except those of type T.
- Equivalent to remove_if<boost::is_same<_,T> >(seq).
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
+ in their original order, except those of type T
.
+ Equivalent to
.
remove_if
<boost::is_same<_,T> >(seq)
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/remove.hpp>
-const vector<int,double> vec(1,2.0); -assert(remove<double>(vec) == make_vector(1)); +constvector
<int,double> vec(1,2.0); +assert(remove
<double>(vec) ==make_vector
(1));
seq | +seq |
A model of Forward @@ -68,7 +68,7 @@ | Operation's argument |
Pred | +Pred |
A model of unary MPL Lambda Expression | Removal predicate | @@ -77,46 +77,46 @@
-remove_if<Pred>(seq);
+remove_if
<Pred>(seq);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- all the elements of seq,
+ Semantics: Returns a new sequence, containing
+ all the elements of seq
,
in their original order, except those elements with types for which
- Pred evaluates to boost::mpl::true_. Equivalent to filter<boost::mpl::not_<Pred>
- >(seq).
+ Pred
evaluates to boost::mpl::true_
. Equivalent to
.
filter
<boost::mpl::not_<Pred>
+ >(seq)
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/remove_if.hpp>
-const vector<int,double> vec(1,2.0); -assert(remove_if<is_floating_point<mpl::_> >(vec) == make_vector(1)); +constvector
<int,double> vec(1,2.0); +assert(remove_if
<is_floating_point<mpl::_> >(vec) ==make_vector
(1));
seq | +seq |
A
model of Forward
- Sequence, e == old_value
- is a valid expression, convertible to bool,
- for each element e
- in seq with type
- convertible to T
+ Sequence, e == old_value
+ is a valid expression, convertible to bool ,
+ for each element e
+ in seq with type
+ convertible to T
|
Operation's argument |
old_value | +old_value |
Any type | Value to replace |
new_value | +new_value |
Any type | Replacement value | @@ -89,44 +89,44 @@
-replace(seq, old_value, new_value);
+replace
(seq, old_value, new_value);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence with
- all the values of seq
- with new_value assigned
- to elements with the same type and equal to old_value.
+ Semantics: Returns a new sequence with
+ all the values of seq
+ with new_value
assigned
+ to elements with the same type and equal to old_value
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/replace.hpp>
-assert(replace(make_vector(1,2), 2, 3) == make_vector(1,3)); +assert(replace
(make_vector
(1,2), 2, 3) ==make_vector
(1,3));
seq | +seq |
A model of Forward @@ -70,16 +70,16 @@ | Operation's argument |
f | +f |
A
- function object for which f(e) is a valid expression, convertible
- to bool, for each element
- e in seq
+ function object for which f(e) is a valid expression, convertible
+ to bool , for each element
+ e in seq
|
Operation's argument |
new_value | +new_value |
Any type | Replacement value | @@ -88,41 +88,41 @@
-replace_if(seq, f, new_value);
+replace_if
(seq, f, new_value);
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence with
- all the elements of seq,
- with new_value assigned
- to each element for which f
- evaluates to true.
+ Semantics: Returns a new sequence with
+ all the elements of seq
,
+ with new_value
assigned
+ to each element for which f
+ evaluates to true
.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/replace_if.hpp>
@@ -135,7 +135,7 @@ } }; ... -assert(replace_if(make_vector(1,2), odd(), 3) == make_vector(3,2)); +assert(replace_if
(make_vector
(1,2), odd(), 3) ==make_vector
(3,2));
Description | ||
---|---|---|
seq | +seq |
A model of Bidirectional @@ -67,43 +67,43 @@ |
-reverse(seq);
+reverse
(seq);
- Return type: A model of Return type: A model of Bidirectional Sequence.
- Semantics: Returns a new sequence containing
- all the elements of seq
+ Semantics: Returns a new sequence containing
+ all the elements of seq
in reverse order.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/reverse.hpp>
-assert(reverse(make_vector(1,2,3)) == make_vector(3,2,1)); +assert(reverse
(make_vector
(1,2,3)) ==make_vector
(3,2,1));
seq | +seq |
A model of Forward @@ -74,12 +74,12 @@ | Operation's argument |
f | +f |
A
model of unary Polymorphic
- Function Object where f(e) is a valid expression for each element
- e of seq
+ Function Object where f(e) is a valid expression for each element
+ e of seq
|
Transformation function | @@ -88,25 +88,25 @@
-transform(seq, f);
+transform
(seq, f);
- Return type: A model of Return type: A model of Forward Sequence
- Semantics: Returns a new sequence, containing
- the return values of f(e) for each element e
- within seq.
+ Semantics: Returns a new sequence, containing
+ the return values of f(e)
for each element e
+ within seq
.
result_of::transform
<Sequence1 const, Sequence2 const, F>::type transform(
Sequence1 const& seq1, Sequence2 const& seq2, F f);
Table 1.55. Parameters
+Table 1.55. Parameters
seq1 | +seq1 |
A model of Forward @@ -143,7 +143,7 @@ | Operation's argument |
seq2 | +seq2 |
A model of Forward @@ -152,13 +152,13 @@ | Operation's argument |
f | +f |
A
model of binary Polymorphic
- Function Object where f(e1, e2) is a valid expression for each pair
- of elements e1 and
- e2 of seq1 and seq2
+ Function Object where f(e1, e2) is a valid expression for each pair
+ of elements e1 and
+ e2 of seq1 and seq2
respectively |
Transformation function |
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a new sequence, containing
- the return values of f(e1, e2) for each pair of elements e1 and e2
- within seq1 and seq2 respectively.
+ Semantics: Returns a new sequence, containing
+ the return values of f(e1, e2)
for each pair of elements e1
and e2
+ within seq1
and seq2
respectively.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/transform.hpp>
@@ -209,7 +209,7 @@ }; }; ... -assert(transform(make_vector(1,2,3), triple()) == make_vector(3,6,9)); +assert(transform
(make_vector
(1,2,3), triple()) ==make_vector
(3,6,9));
-seq1 to seqN
+seq1 to seqN
|
Each sequence
is a model of - + Expression Semantics
-zip(seq1, seq2, ... seqN);
+
- Return type: A model of Return type: A model of Forward Sequence.
- Semantics: Returns a sequence containing
- tuples of elements from sequences seq1
- to seqN. For example,
- applying zip to tuples (1, 2, 3)
- and ('a', 'b',
- 'c')
- would return ((1, 'a'),(2, 'b'),(3,
- 'c'))
+ Semantics: Returns a sequence containing
+ tuples of elements from sequences - + ComplexityConstant. Returns a view which is lazily evaluated. - + Header#include <boost/fusion/algorithm/transformation/zip.hpp> - + Example-vector<int,char> v1(1, 'a'); -vector<int,char> v2(2, 'b'); -assert(zip(v1, v2) == make_vector(make_vector(1, 2),make_vector('a', 'b')); +
- + Expression Semantics
-result_of::clear<Sequence>::type
+
- Return type: A model of Return type: A model of Forward Sequence. - Semantics: Returns an empty sequence. + Semantics: Returns an empty sequence. - + ComplexityConstant. - + Headerdiff --git a/doc/html/fusion/algorithms/transformation/metafunctions/erase.html b/doc/html/fusion/algorithms/transformation/metafunctions/erase.html index 927c3c3c..9848b0ef 100644 --- a/doc/html/fusion/algorithms/transformation/metafunctions/erase.html +++ b/doc/html/fusion/algorithms/transformation/metafunctions/erase.html @@ -3,7 +3,7 @@ struct_type
+ and index provide convenient
access to information we will need later in the implementation.
category allows
+ the traits::
metafunction to establish the traversal category of the iterator.
example_struct
being iterated over.
We also need to enable tag
dispatching for our iterator type, with another specialization
- of traits::tag_of.
+ of In isolation, the iterator implementation is pretty dry. Things should become clearer as we add features to our implementation. - + A first couple of instructive features
- To start with, we will get the result_of::value_of metafunction working. To
- do this, we provide a specialization of the boost::fusion::extension::value_of_impl
+ To start with, we will get the @@ -215,29 +215,29 @@
The implementation itself is pretty simple, it just uses 2 partial specializations
- to provide the type of the 2 different members of example_struct,
+ to provide the type of the 2 different members of
- To understand how value_of_impl
- is used by the library we will look at the implementation of value_of:
+ To understand how
template <typename Iterator>
-struct value_of
+struct
- So value_of
+ So
Ok, lets enable dereferencing of our iterator. In this case we must provide
- a suitable specialization of deref_impl.
+ a suitable specialization of template<> @@ -275,17 +275,17 @@ }
- The use of deref_impl is very
- similar to that of value_of_impl,
- but it also provides some runtime functionality this time via the call static member function. To see how
- deref_impl is used, lets have
- a look at the implementation of deref:
+ The use of namespace result_of { template <typename Iterator> - struct deref + struct
- So again result_of::deref uses tag
- dispatching in exactly the same way as the value_of implementation. The runtime
- functionality used by deref is provided by the call static function of the selected MPL
+ So again
- The actual implementation of deref_impl
- is slightly more complex than that of value_of_impl.
- We also need to implement the call
+ The actual implementation of
- + Implementing the remaining iterator functionality
- Ok, now we have seen the way value_of and deref work, everything else will work
+ Ok, now we have seen the way template<> @@ -356,40 +356,40 @@ };
- This should be very familiar from our deref_impl
+ This should be very familiar from our
- We also need to provide a suitable equal_to_impl
+ We also need to provide a suitable
- Full implementations of prior_impl,
- advance_impl, distance_impl and equal_to_impl
+ Full implementations of - + Implementing the intrinsic functions of the sequence
In order that Fusion can correctly identify our sequence as a Fusion sequence,
- we need to enable is_sequence
- for our sequence type. As usual we just create an impl
+ we need to enable
@@ -401,14 +401,14 @@
};
- We've some similar formalities to complete, providing category_of_impl
- so Fusion can correctly identify our sequence type, and is_view_impl
+ We've some similar formalities to complete, providing
Now we've completed some formalities, on to more interesting features. Lets
- get begin working so that we can get an
+ get @@ -431,32 +431,32 @@ next(i) |
+
Bidirectional
Iterator |
Constant |
prior(i) |
+
Bidirectional
Iterator |
Constant |
advance_c<N>(i) |
+
Bidirectional
Iterator |
Constant |
advance<M>(i) |
+
Bidirectional
Iterator |
@@ -123,7 +123,7 @@
- + Meta Expressions@@ -137,13 +137,13 @@ | Compile Time Complexity | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
result_of::prior<I>::type | +
|
Amortized constant time |
prior
(i)
i
@@ -179,44 +179,44 @@ Iterator, the following invariants always hold:
std::pair
iterator
boost::array
iterator
vector
iterator
iterator_range
(where adapted sequence is a Bidirectional
Sequence)
transform_view
(where adapted sequence is a Bidirectional
Sequence)
reverse_view
next(i) | +
|
Forward Iterator | Constant | |
i == - j | +i ==
+ j |
Convertible to bool | Constant | |
i != - j | +i !=
+ j |
Convertible to bool | Constant | |
advance_c<N>(i) | +
|
Forward Iterator | Constant | |
advance<M>(i) | +
|
Forward Iterator | Constant | |
distance(i, j) | -result_of::distance<I, J>::type | +
|
+
|
Constant |
deref(i) | -result_of::deref<I>::type | +
|
+
|
Constant |
*i | -result_of::deref<I>::type | +*i |
+
|
Constant |
result_of::next
<I>::type
result_of::equal_to
<I, J>::type
result_of::advance_c
<I, N>::type
result_of::advance
<I ,M>::type
result_of::distance
<I ,J>::type
result_of::deref
<I>::type
result_of::value_of
<I>::type
next
(i)
i
i ==
+ j
i !=
+ j
advance_c
<N>(i)
i
in the sequenceadvance
<M>(i)
advance_c<M::value>(i)
distance
(i, j)
i
+ and j
deref
(i)
i
*i
deref(i)
The following invariants always hold:
!(i
+ == j) == (i != j)
next
(i) == advance_c
<1>(i)
distance
(i, advance_c
<N>(i)) == N
next
to traverse the
sequence will never return to a previously seen position
deref
(i)
+ is equivalent to *i
i ==
+ j
then *i
is equivalent to *j
std::pair
iterator
boost::array
iterator
vector
iterator
cons
iterator
list
iterator
set
iterator
map
iterator
single_view
iterator
filter_view
iterator
iterator_range
iterator
joint_view
iterator
transform_view
iterator
reverse_view
iterator
@@ -41,29 +41,29 @@
Notation
i
,
+ j
I
,
+ J
M
N
next
(i)
prior
(i)
advance_c
<N>(i)
advance
<M>(i)
result_of::advance_c
<I, N>::type
result_of::advance
<I, M>::type
result_of::distance
<I ,J>::type
vector
iterator
std::pair
iterator
boost::array
iterator
iterator_range
iterator (where adapted sequence is a Random
Access Sequence)
transform_view
iterator (where adapted sequence is a Random
Access Sequence)
reverse_view
iterator (where adapted sequence is a Random
Access Sequence)
diff --git a/doc/html/fusion/iterators/functions.html b/doc/html/fusion/iterators/functions.html
index 29d6130e..baf7254f 100644
--- a/doc/html/fusion/iterators/functions.html
+++ b/doc/html/fusion/iterators/functions.html
@@ -3,7 +3,7 @@
Moves an iterator by a specified distance.
@@ -41,10 +41,10 @@
typename I,
typename M
>
-typename result_of::advance<I, M>::type advance(I const& i);
+typename result_of::advance
<I, M>::type advance(I const& i);
Table 1.6. Parameters
+Table 1.6. Parameters
i | +i |
Model of Forward @@ -67,7 +67,7 @@ | Iterator to move relative to |
N | +N |
An MPL Integral Constant | Number of positions to move | @@ -76,42 +76,42 @@
-advance<M>(i);
+advance
<M>(i);
- Return type: A model of the same iterator
- concept as i.
+ Return type: A model of the same iterator
+ concept as i
.
- Semantics: Returns an iterator to the
- element M positions from
- i. If i
+ Semantics: Returns an iterator to the
+ element M
positions from
+ i
. If i
is a Bidirectional
- Iterator then M
+ Iterator then M
may be negative.
#include <boost/fusion/iterator/advance.hpp>
-typedef vector<int,int,int> vec; +typedefvector
<int,int,int> vec; vec v(1,2,3); -assert(deref(advance<mpl::int_<2> >(begin(v))) == 3); +assert(deref
(advance
<mpl::int_<2> >(begin
(v))) == 3);
i | +i |
Model of Forward @@ -67,7 +67,7 @@ | Iterator to move relative to |
N | +N |
Integer constant | Number of positions to move | @@ -76,42 +76,42 @@
-advance_c<N>(i);
+advance_c
<N>(i);
- Return type: A model of the same iterator
- concept as i.
+ Return type: A model of the same iterator
+ concept as i
.
- Semantics: Returns an iterator to the
- element N positions from
- i. If i
+ Semantics: Returns an iterator to the
+ element N
positions from
+ i
. If i
is a Bidirectional
- Iterator then N
+ Iterator then N
may be negative.
#include <boost/fusion/iterator/advance.hpp>
-typedef vector<int,int,int> vec; +typedefvector
<int,int,int> vec; vec v(1,2,3); -assert(deref(advance_c<2>(begin(v))) == 3); +assert(deref
(advance_c
<2>(begin
(v))) == 3);
Description | ||
---|---|---|
i | +i |
Model of Forward @@ -67,39 +67,39 @@ |
-deref(i);
+deref
(i);
- Return type: result_of::deref<I>::type
+ Return type: result_of::deref
<I>::type
- Semantics: Dereferences the iterator
- i.
+ Semantics: Dereferences the iterator
+ i
.
#include <boost/fusion/iterator/deref.hpp>
-typedef vector<int,int&> vec; +typedefvector
<int,int&> vec; int i(0); vec v(1,i); -assert(deref(begin(v)) == 1); -assert(deref(next(begin(v))) == 0); -assert(&(deref(next(begin(v)))) == &i); +assert(deref
(begin
(v)) == 1); +assert(deref
(next
(begin
(v))) == 0); +assert(&(deref
(next
(begin
(v)))) == &i);
-i, j
+i , j
|
Models of Forward @@ -69,36 +69,36 @@ |
-distance(i,j);
+distance
(i,j);
- Return type: int
+ Return type: int
- Semantics: Returns the distance between
- iterators i and j.
+ Semantics: Returns the distance between
+ iterators i
and j
.
#include <boost/fusion/iterator/distance.hpp>
-typedef vector<int,int,int> vec; +typedefvector
<int,int,int> vec; vec v(1,2,3); -assert(distance(begin(v), next(next(begin(v)))) == 2); +assert(distance
(begin
(v),next
(next
(begin
(v)))) == 2);
Description | ||
---|---|---|
i | +i |
Model of Forward @@ -67,7 +67,7 @@ |
- Return type: A model of the same iterator
- concept as i.
+ Return type: A model of the same iterator
+ concept as i
.
- Semantics: Returns an iterator to the
- next element after i.
+ Semantics: Returns an iterator to the
+ next element after i
.
#include <boost/fusion/iterator/next.hpp>
-typedef vector<int,int,int> vec; +typedefvector
<int,int,int> vec; vec v(1,2,3); -assert(deref(begin(v)) == 1); -assert(deref(next(begin(v))) == 2); -assert(deref(next(next(begin(v)))) == 3); +assert(deref
(begin
(v)) == 1); +assert(deref
(next
(begin
(v))) == 2); +assert(deref
(next
(next
(begin
(v)))) == 3);
Description | ||
---|---|---|
i | +i |
Model of Bidirectional @@ -67,38 +67,38 @@ |
-prior(i);
+prior
(i);
- Return type: A model of the same iterator
- concept as i.
+ Return type: A model of the same iterator
+ concept as i
.
- Semantics: Returns an iterator to the
- element prior to i.
+ Semantics: Returns an iterator to the
+ element prior to i
.
#include <boost/fusion/iterator/prior.hpp>
-typedef vector<int,int> vec; +typedefvector
<int,int> vec; vec v(1,2); -assert(deref(next(begin(v))) == 2); -assert(deref(prior(next(begin(v)))) == 1); +assert(deref
(next
(begin
(v))) == 2); +assert(deref
(prior
(next
(begin
(v)))) == 1);
I | +I |
Model of Forward @@ -70,7 +70,7 @@ | Iterator to move relative to |
M | +M |
Model of MPL Integral Constant | Number of positions to move | @@ -79,43 +79,43 @@
-result_of::advance<I,M>::type
+result_of::advance
<I,M>::type
- Return type: A model of the same iterator
- concept as I.
+ Return type: A model of the same iterator
+ concept as I
.
- Semantics: Returns an iterator a distance
- M from I.
- If I is a Semantics: Returns an iterator a distance
+ M
from I
.
+ If I
is a Bidirectional
- Iterator then M
+ Iterator then M
may be negative.
#include <boost/fusion/iterator/advance.hpp>
-typedef vector<int,double,char> vec; -typedef result_of::begin<vec>::type first; -typedef result_of::next<first>::type second; -typedef result_of::next<second>::type third; +typedefvector
<int,double,char> vec; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::next
<first>::type second; +typedefresult_of::next
<second>::type third; -BOOST_MPL_ASSERT((result_of::equal_to<result_of::advance<first, boost::mpl::int_<2> >::type, third>)); +BOOST_MPL_ASSERT((result_of::equal_to
<result_of::advance
<first, boost::mpl::int_<2> >::type, third>));
I | +I |
Model of Forward @@ -70,7 +70,7 @@ | Iterator to move relative to |
N | +N |
Integer constant | Number of positions to move | @@ -79,43 +79,43 @@
-result_of::advance_c<I, N>::type
+result_of::advance_c
<I, N>::type
- Return type: A model of the same iterator
- concept as I.
+ Return type: A model of the same iterator
+ concept as I
.
- Semantics: Returns an iterator a distance
- N from I.
- If I is a 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.
+ Iterator then N
+ may be negative. Equivalent to
.
result_of::advance
<I, boost::mpl::int_<N> >::type
#include <boost/fusion/iterator/advance.hpp>
-typedef vector<int,double,char> vec; -typedef result_of::begin<vec>::type first; -typedef result_of::next<first>::type second; -typedef result_of::next<second>::type third; +typedefvector
<int,double,char> vec; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::next
<first>::type second; +typedefresult_of::next
<second>::type third; -BOOST_MPL_ASSERT((result_of::equal_to<result_of::advance_c<first, 2>::type, third>)); +BOOST_MPL_ASSERT((result_of::equal_to
<result_of::advance_c
<first, 2>::type, third>));
Description | ||
---|---|---|
I | +I |
Model of Forward @@ -70,42 +70,42 @@ |
-result_of::deref<I>::type
+result_of::deref
<I>::type
- Return type: Any type + Return type: Any type
- Semantics: Returns the result of dereferencing
- an iterator of type I.
+ Semantics: Returns the result of dereferencing
+ an iterator of type I
.
#include <boost/fusion/iterator/deref.hpp>
-typedef vector<int,int&> vec; +typedefvector
<int,int&> vec; typedef const vec const_vec; -typedef result_of::begin<vec>::type first; -typedef result_of::next<first>::type second; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::next
<first>::type second; -typedef result_of::begin<const_vec>::type const_first; -typedef result_of::next<const_first>::type const_second; +typedefresult_of::begin
<const_vec>::type const_first; +typedefresult_of::next
<const_first>::type const_second; -BOOST_MPL_ASSERT((boost::is_same<result_of::deref<first>::type, int&>)); -BOOST_MPL_ASSERT((boost::is_same<result_of::deref<second>::type, int&>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::deref
<first>::type, int&>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::deref
<second>::type, int&>));
-I, J
+I , J
|
Models of Forward @@ -72,38 +72,38 @@ |
-result_of::distance<I, J>::type
+result_of::distance
<I, J>::type
- Return type: A model of MPL Integral Constant. + Return type: A model of MPL Integral Constant.
- Semantics: Returns the distance between
- iterators of types I and
- J.
+ Semantics: Returns the distance between
+ iterators of types I
and
+ J
.
#include <boost/fusion/iterator/distance.hpp>
-typedef vector<int,double,char> vec; -typedef result_of::begin<vec>::type first; -typedef result_of::next<first>::type second; -typedef result_of::next<second>::type third; -typedef result_of::distance<first,third>::type dist; +typedefdiff --git a/doc/html/fusion/iterators/metafunctions/equal_to.html b/doc/html/fusion/iterators/metafunctions/equal_to.html index 7ddaef92..57fa267a 100644 --- a/doc/html/fusion/iterators/metafunctions/equal_to.html +++ b/doc/html/fusion/iterators/metafunctions/equal_to.html @@ -3,7 +3,7 @@vector
<int,double,char> vec; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::next
<first>::type second; +typedefresult_of::next
<second>::type third; +typedefresult_of::distance
<first,third>::type dist; BOOST_MPL_ASSERT_RELATION(dist::value, ==, 2);
- Returns a true-valued MPL Integral Constant if I
- and J are equal.
+ Returns a true-valued MPL Integral Constant if I
+ and J
are equal.
@@ -48,7 +48,7 @@
};
Table 1.15. Parameters
+Table 1.15. Parameters
-I, J
+I , J
|
Any fusion iterators | Operation's @@ -71,38 +71,38 @@ |
-result_of::equal_to<I, J>::type
+result_of::equal_to
<I, J>::type
- Return type: A model of MPL Integral Constant. + Return type: A model of MPL Integral Constant.
- 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.
#include <boost/fusion/iterator/equal_to.hpp>
-typedef vector<int,double> vec; -typedef result_of::begin<vec>::type first; -typedef result_of::end<vec>::type last; -BOOST_MPL_ASSERT((result_of::equal_to<first, first>)); -BOOST_MPL_ASSERT_NOT((result_of::equal_to<first,last>)); +typedefvector
<int,double> vec; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::end
<vec>::type last; +BOOST_MPL_ASSERT((result_of::equal_to
<first, first>)); +BOOST_MPL_ASSERT_NOT((result_of::equal_to
<first,last>));
Description | ||
---|---|---|
I | +I |
Model of Forward @@ -70,37 +70,37 @@ |
-result_of::next<I>::type
+result_of::next
<I>::type
- Return type: A model of the same iterator
- concept as I.
+ Return type: A model of the same iterator
+ concept as I
.
- 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
.
#include <boost/fusion/iterator/next.hpp>
-typedef vector<int,double> vec; -typedef result_of::next<result_of::begin<vec>::type>::type second; +typedefvector
<int,double> vec; +typedefresult_of::next
<result_of::begin
<vec>::type>::type second; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, double>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<second>::type, double>));
Description | ||
---|---|---|
I | +I |
Model of Bidirectional @@ -70,40 +70,40 @@ |
-result_of::prior<I>::type
+result_of::prior
<I>::type
- Return type: A model of the same iterator
- concept as I.
+ Return type: A model of the same iterator
+ concept as I
.
- 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
.
#include <boost/fusion/iterator/prior.hpp>
-typedef vector<int,double> vec; -typedef result_of::next<result_of::begin<vec>::type>::type second; +typedefvector
<int,double> vec; +typedefresult_of::next
<result_of::begin
<vec>::type>::type second; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, double>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<second>::type, double>)); -typedef result_of::prior<second>::type first; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<first>::type, int>)); +typedefresult_of::prior
<second>::type first; +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<first>::type, int>));
Description | ||
---|---|---|
I | +I |
Model of Forward @@ -70,40 +70,40 @@ |
-result_of::value_of<I>::type
+result_of::value_of
<I>::type
- Return type: Any type + Return type: Any type
- Semantics: Returns the type stored in
- a sequence at iterator position I.
+ Semantics: Returns the type stored in
+ a sequence at iterator position I
.
#include <boost/fusion/iterator/value_of.hpp>
-typedef vector<int,int&,const int&> vec; -typedef result_of::begin<vec>::type first; -typedef result_of::next<first>::type second; -typedef result_of::next<second>::type third; +typedefvector
<int,int&,const int&> vec; +typedefresult_of::begin
<vec>::type first; +typedefresult_of::next
<first>::type second; +typedefresult_of::next
<second>::type third; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<first>::type, int>)); -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, int&>)); -BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<third>::type, const int&>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<first>::type, int>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<second>::type, int&>)); +BOOST_MPL_ASSERT((boost::is_same<result_of::value_of
<third>::type, const int&>));
-i, j
+i , j
|
Any fusion iterators | Operation's @@ -72,7 +72,7 @@ |
- Return type: Convertible to bool.
+ Return type: Convertible to bool
.
- 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
+ where result_of::equal_to
<I,J>::valueI
and J
are the types of i
+ and j
respectively.
diff --git a/doc/html/fusion/iterators/operators/operator_inequality.html b/doc/html/fusion/iterators/operators/operator_inequality.html index 0c9316e9..115065f3 100644 --- a/doc/html/fusion/iterators/operators/operator_inequality.html +++ b/doc/html/fusion/iterators/operators/operator_inequality.html @@ -4,7 +4,7 @@Operator != - + Operator !=- + Description
Compares 2 iterators for inequality.
- + Synopsis
@@ -48,7 +48,7 @@ unspecified operator==(I const& i, J const& i);-Table 1.10. Parameters
+Table 1.10. Parameters
@@ -62,7 +62,7 @@ -i, j + i
,j
Any fusion iterators Operation's @@ -71,20 +71,20 @@ - + Expression Semantics
- Return type: Convertible to bool. + Return type: Convertible to
bool
.- 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
!
+ whereresult_of::equal_to
<I,J>::valueI
andJ
are the types ofi
+ andj
respectively.- + Header
diff --git a/doc/html/fusion/iterators/operators/operator_unary_star.html b/doc/html/fusion/iterators/operators/operator_unary_star.html index 3262b0c3..bf405c7c 100644 --- a/doc/html/fusion/iterators/operators/operator_unary_star.html +++ b/doc/html/fusion/iterators/operators/operator_unary_star.html @@ -4,7 +4,7 @@Operator * - + @@ -30,24 +30,24 @@ *"> Operator *- + Description
Dereferences an iterator.
- + Synopsis
template< typename I > -typename result_of::deref<I>::type operator*(unspecified<I> const& i); +typenameresult_of::deref
<I>::type operator*(unspecified<I> const& i);-Table 1.8. Parameters
+Table 1.8. Parameters
@@ -60,7 +60,7 @@ Description - i +i
Model of Forward @@ -71,7 +71,7 @@ - + Expression Semantics
@@ -79,31 +79,31 @@ *i- Return type: Equivalent to the return - type of deref(i). + Return type: Equivalent to the return + type of
.
deref
(i)- Semantics: Equivalent to deref(i). + Semantics: Equivalent to
.
deref
(i)- + Header
#include <boost/fusion/iterator/deref.hpp>- + Example
-typedef vector<int,int&> vec; +typedefvector
<int,int&> vec; int i(0); vec v(1,i); -assert(*begin(v) == 1); -assert(*next(begin(v)) == 0); -assert(&(*next(begin(v))) == &i); +assert(*begin
(v) == 1); +assert(*next
(begin
(v)) == 0); +assert(&(*next
(begin
(v))) == &i);
![]() |
Caution |
---|---|
- The result of typeid(x).name() is platform specific. The code here is + | |
+ The result of |
- for_each is generic. With
- print_xml, you can use it to
+
is generic. With
+ for_each
print_xml
, you can use it to
print just about any Fusion Sequence.
Let's get a little cleverer. Say we wish to write a generic
function that takes in an arbitrary sequence and XML prints only those elements
- which are pointers. Ah, easy. First, let's include the is_pointer
+ which are pointers. Ah, easy. First, let's include the is_pointer
boost type trait:
@@ -135,36 +135,36 @@ template <typename Sequence> void xml_print_pointers(Sequence const& seq) { - for_each(filter_if<boost::is_pointer<_> >(seq), print_xml()); +for_each
(filter_if
<boost::is_pointer<_> >(seq), print_xml()); }
- filter_if is another Fusion
- algorithm. It returns a filter_view, a conforming Fusion sequence.
+
is another Fusion
+ algorithm. It returns a filter_if
filter_view
, a conforming Fusion sequence.
This view reflects only those elements that pass the given predicate. In this
- case, the predicate is boost::is_pointer<_>.
- This "filtered view" is then passed to the for_each algorithm, which then prints
+ case, the predicate is boost::is_pointer<_>
.
+ This "filtered view" is then passed to the for_each
algorithm, which then prints
the "filtered view" as XML.
Easy, right?
Ok, moving on...
- Apart from vector, fusion has a couple
+ Apart from
, fusion has a couple
of other sequence types to choose from. Each sequence has its own characteristics.
- We have list, set, map, plus a multitude of views that provide various ways to present
+ We have vector
, list
, set
, plus a multitude of map
views
that provide various ways to present
the sequences.
- Fusion's map associate types with elements.
- It can be used as a cleverer replacement of the struct.
+ Fusion's
associate types with elements.
+ It can be used as a cleverer replacement of the map
struct
.
Example:
@@ -174,32 +174,32 @@ struct age; } -typedef map< - fusion::pair<fields::name, std::string> - , fusion::pair<fields::age, int> > +typedefmap
< +fusion::pair
<fields::name, std::string> + ,fusion::pair
<fields::age, int> > person;
- map
+
is an associative sequence. Its elements are Fusion pairs which differ somewhat
- from std::pair. Fusion pairs only contain one member,
+ from map
std::pair
. Fusion pairs only contain one member,
with the type of their second template parameter. The first type parameter
of the pair is used as an index to the associated element in the sequence.
- For example, given a a_person
- of type, person, you can do:
+ For example, given a a_person
+ of type, person
, you can do:
using namespace fields; -std::string person_name = at_key<name>(a_person); -int person_age = at_key<age>(a_person); +std::string person_name =at_key
<name>(a_person); +int person_age =at_key
<age>(a_person);
- Why go through all this trouble, you say? Well, for one, unlike the struct, we are dealing with a generic data structure.
+ Why go through all this trouble, you say? Well, for one, unlike the struct
, we are dealing with a generic data structure.
There are a multitude of facilities available at your disposal provided out
of the box with fusion or written by others. With these facilities, introspection
comes for free, for example. We can write one serialization function (well,
two, if you consider loading and saving) that will work for all your fusion
- maps.
+
s.
Example:
map
@@ -215,17 +215,17 @@
template <typename Stuff>
void save(Stuff const& stuff)
{
- for_each(stuff, saver());
+ for_each
(stuff, saver());
}
- The save function is generic
- and will work for all types of stuff
- regardless if it is a person,
- a dog or a whole alternate_universe.
+ The save
function is generic
+ and will work for all types of stuff
+ regardless if it is a person
,
+ a dog
or a whole alternate_universe
.
@@ -236,14 +236,14 @@
[1] +
[1] There are finer grained header files available if you wish to have more control over which components to include (see section Orgainization for details).
[2] - Unless otherwise noted, components are in namespace boost::fusion. - For the sake of simplicity, code in this quick start implies using directives for the fusion components +
[2]
+ Unless otherwise noted, components are in namespace boost::fusion
.
+ For the sake of simplicity, code in this quick start implies using
directives for the fusion components
we will be using.
diff --git a/doc/html/fusion/sequences/adapted.html b/doc/html/fusion/sequences/adapted.html index f7f9cd89..c13a9200 100644 --- a/doc/html/fusion/sequences/adapted.html +++ b/doc/html/fusion/sequences/adapted.html @@ -3,7 +3,7 @@Adapted - + @@ -26,18 +26,18 @@- Fusion provides a couple of adapters for other sequences such as std::pair, + Fusion provides a couple of adapters for other sequences such as
std::pair
, MPL sequences, - and boost::array. These adapters are written using + andboost::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 - [4] + [4] .- + Header
@@ -45,7 +45,7 @@
-[4] +
[4] 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 diff --git a/doc/html/fusion/sequences/adapted/boost__array.html b/doc/html/fusion/sequences/adapted/boost__array.html index 42004874..574ac5e0 100644 --- a/doc/html/fusion/sequences/adapted/boost__array.html +++ b/doc/html/fusion/sequences/adapted/boost__array.html @@ -3,7 +3,7 @@
boost::array - + @@ -26,41 +26,41 @@- This module provides adapters for boost::array. - Including the module header makes boost::array + This module provides adapters for
boost::array
. + Including the module header makesboost::array
a fully conforming Random Access Sequence.- + Header
#include <boost/fusion/sequence/adapted/array.hpp>- + Model of
- + 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; +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;- + See also
diff --git a/doc/html/fusion/sequences/adapted/boost__tuple.html b/doc/html/fusion/sequences/adapted/boost__tuple.html index d161ce16..7d31fed4 100644 --- a/doc/html/fusion/sequences/adapted/boost__tuple.html +++ b/doc/html/fusion/sequences/adapted/boost__tuple.html @@ -3,7 +3,7 @@
boost::tuple - + @@ -26,27 +26,27 @@- This module provides adapters for boost::tuple. - Including the module header makes boost::tuple + This module provides adapters for
boost::tuple
. + Including the module header makesboost::tuple
a fully conforming Forward Sequence.- + Header
#include <boost/fusion/sequence/adapted/boost_tuple.hpp>- + Model of
- + Example
@@ -55,7 +55,7 @@ std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n';- + See also
diff --git a/doc/html/fusion/sequences/adapted/boost__variant.html b/doc/html/fusion/sequences/adapted/boost__variant.html index fd3e7416..28aedfc1 100644 --- a/doc/html/fusion/sequences/adapted/boost__variant.html +++ b/doc/html/fusion/sequences/adapted/boost__variant.html @@ -3,7 +3,7 @@
boost::variant - + @@ -26,8 +26,8 @@- This module provides adapters for boost::variant. - Including the module header makes boost::variant + This module provides adapters for
boost::variant
. + Including the module header makesboost::variant
a fully conforming Forward Sequence. The variant acts as a sequence of the types that can be @@ -36,21 +36,21 @@ value of that type.- + Header
#include <boost/fusion/sequence/adapted/variant.hpp>- + Model of
- + Example
@@ -60,7 +60,7 @@ std::cout << example_variant << '\n';- + See also
diff --git a/doc/html/fusion/sequences/adapted/mpl_sequence.html b/doc/html/fusion/sequences/adapted/mpl_sequence.html index 184b5522..1b050496 100644 --- a/doc/html/fusion/sequences/adapted/mpl_sequence.html +++ b/doc/html/fusion/sequences/adapted/mpl_sequence.html @@ -3,7 +3,7 @@
mpl sequence - + @@ -31,14 +31,14 @@ sequences fully conforming fusion sequences.- + Header
#include <boost/fusion/sequence/adapted/mpl.hpp>- + Model of
@@ -62,21 +62,21 @@
- + 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; +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; +std::cout <<at_c
<0>(v) << std::endl; +std::cout <<at_c
<1>(v) << std::endl;- + See also
diff --git a/doc/html/fusion/sequences/adapted/std__pair.html b/doc/html/fusion/sequences/adapted/std__pair.html index e079ae74..8b89c766 100644 --- a/doc/html/fusion/sequences/adapted/std__pair.html +++ b/doc/html/fusion/sequences/adapted/std__pair.html @@ -3,7 +3,7 @@
std::pair - + @@ -26,44 +26,44 @@- This module provides adapters for std::pair. - Including the module header makes std::pair + This module provides adapters for
std::pair
. + Including the module header makesstd::pair
a fully conforming Random Access Sequence.- + Header
#include <boost/fusion/sequence/adapted/std_pair.hpp>- + Model of
- + 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 <<at_c
<0>(p) << std::endl; +std::cout <<at_c
<1>(p) << std::endl; std::cout << p << std::endl;- + See also
- std::pair, - TR1 - and std::pair +
std::pair
, +TR1 + and std::pair
diff --git a/doc/html/fusion/sequences/concepts.html b/doc/html/fusion/sequences/concepts.html index 680b35ac..f4706530 100644 --- a/doc/html/fusion/sequences/concepts.html +++ b/doc/html/fusion/sequences/concepts.html @@ -3,7 +3,7 @@ Concepts - + @@ -30,7 +30,7 @@ Fusion Sequences are organized into a hierarchy of concepts.- + Traversal
@@ -48,7 +48,7 @@ Sequence. These concepts pertain to sequence traversal.
- + Associativity
diff --git a/doc/html/fusion/sequences/concepts/associative_sequence.html b/doc/html/fusion/sequences/concepts/associative_sequence.html index f54484d0..3222fdc8 100644 --- a/doc/html/fusion/sequences/concepts/associative_sequence.html +++ b/doc/html/fusion/sequences/concepts/associative_sequence.html @@ -4,7 +4,7 @@
Associative Sequence - + Associative Sequence- + Description
@@ -48,30 +48,30 @@
Notation
-
- s
+s
- An Associative Sequence
-- S
+S
- An Associative Sequence type
-- K
+K
- An arbitrary key type
-- o
+o
- An arbitrary object
-- e
+e
- A Sequence element
- + Valid Expressions
@@ -94,34 +94,34 @@- has_key<K>(s) +
has_key
<K>(s)MPL Boolean Constant. Convertible to bool. Constant - at_key<K>(s) +
at_key
<K>(s)Any type Constant - at_key<K>(s) = o +
at_key
<K>(s) = oAny type -s - is mutable and e = o, - where e is the first + s
+ is mutable ande = o
, + wheree
is the first element in the sequence, is a valid expression.Constant - + Result Type Expressions
@@ -136,32 +136,32 @@- result_of::has_key<S, K>::type +
result_of::has_key
<S, K>::typeAmortized constant time - result_of::at_key<S, K>::type +
result_of::at_key
<S, K>::typeAmortized constant time - result_of::value_at_key<S, K>::type +
result_of::value_at_key
<S, K>::typeAmortized constant time
- result_of::at_key<S, K> returns the actual type returned by
- at_key<K>(s). In
+
returns the actual type returned by
+ result_of::at_key
<S, K>
. In
most cases, this is a reference. Hence, there is no way to know the exact
- element type using result_of::at_key<S, K>.The element at K
+ element type using at_key
<K>(s)
.The element at result_of::at_key
<S, K>K
may actually be a reference to begin with. For this purpose, you can use
- result_of::value_at_key<S, N>.
+
.
result_of::value_at_key
<S, N>
has_key
<K>(s)
c
+ such that c::value ==
+ true
if and only if there
+ is one or more elements with the key k
+ in s
; see has_key
.
at_key
<K>(s)
K
+ in the sequence s
;
+ see at
.
begin(s) | +
|
Bidirectional Iterator | @@ -105,7 +105,7 @@Constant | |
end(s) | +
|
Bidirectional Iterator | @@ -113,27 +113,27 @@Constant | |
back(s) | +
|
Any type | Constant | |
back(s) = o | +
|
Any type |
-s
- is mutable and e = o,
- where e is the first
+s
+ is mutable and e = o ,
+ where e is the first
element in the sequence, is a valid expression. |
Constant |
result_of::begin
<S>::type
result_of::end
<S>::type
result_of::back
<S>::type
back
(s)
back
.
std::pair
boost::array
vector
iterator_range
(where adapted sequence is a Bidirectional Sequence)
transform_view
(where adapted sequence is a Bidirectional Sequence)
reverse_view
begin(s) | +
|
Forward Iterator | Constant | |
end(s) | +
|
Forward Iterator | Constant | |
size(s) | +
|
MPL Integral Constant. Convertible to int. | Constant | |
empty(s) | +
|
MPL Boolean Constant. Convertible to bool. | Constant | |
front(s) | +
|
Any type | Constant | |
front(s) = o | +
|
Any type |
-s
- is mutable and e = o,
- where e is the first
+s
+ is mutable and e = o ,
+ where e is the first
element in the sequence, is a valid expression. |
Constant |
result_of::begin
<S>::type
result_of::end
<S>::type
result_of::size
<S>::type
result_of::empty
<S>::type
result_of::front
<S>::type
begin
(s)
begin
.
end
(s)
end
.
size
(s)
size
.
empty
(s)
c
+ such that c::value ==
+ true
if and only if the sequence
+ is empty; see empty
.
front
(s)
front
.
@@ -226,41 +226,41 @@
[begin
(s), end
(s))
is always a valid range.
[begin
(s), end
(s))
will pass through every element of
+ s
exactly once.
begin
(s)
+ is identical to end
(s))
+ if and only if s
is empty.
s
will access its elements in the same order.
begin(s) | +
|
Random Access Iterator | @@ -111,7 +111,7 @@Constant | |
end(s) | +
|
Random Access Iterator | @@ -119,27 +119,27 @@Constant | |
at<N>(s) | +
|
Any type | Constant | |
at<N>(s) = o | +
|
Any type |
-s
- is mutable and e = o,
- where e is the first
+s
+ is mutable and e = o ,
+ where e is the first
element in the sequence, is a valid expression. |
Constant |
result_of::begin
<S>::type
result_of::end
<S>::type
result_of::at
<S, N>::type
result_of::value_at
<S, N>::type
- result_of::at<S, N> returns the actual type returned by
- at<N>(s). In
+
returns the actual type returned by
+ result_of::at
<S, N>
. In
most cases, this is a reference. Hence, there is no way to know the exact
- element type using result_of::at<S, N>.The element at N
+ element type using at
<N>(s)
.The element at result_of::at
<S, N>N
may actually be a reference to begin with. For this purpose, you can use
- result_of::value_at<S, N>.
+
.
result_of::value_at
<S, N>
at
<N>(s)
at
.
std::pair
boost::array
vector
iterator_range
(where adapted sequence is a Random Access Sequence)
transform_view
(where adapted sequence is a Random Access Sequence)
reverse_view
Car | +Car |
Head type | ||
Cdr | +Cdr |
Tail type | -nil | +nil |
nil()
C()
C(car)
car
head
and default constructed tail.C(car,
+ cdr)
car
head
+ and cdr
tail.
C(s)
s
.
l =
+ s
l
, from
a Forward
- Sequence, s.s
.
at
<N>(l)
at
.
- at<N>(l) is
+
is
provided for convenience and compatibility with the original Boost.Tuple
- library, despite cons being
+ library, despite at
<N>(l)cons
being
a Forward Sequence
- only (at is supposed to
+ only (at
is supposed to
be a Random
- Access Sequence requirement). The runtime complexity of at is constant (see Recursive
+ Access Sequence requirement). The runtime complexity of at
is constant (see Recursive
Inlined Functions).
cons<int, cons<float> > l(12, cons<float>(5.5f)); -std::cout << at<0>(l) << std::endl; -std::cout << at<1>(l) << std::endl; +std::cout <<at
<0>(l) << std::endl; +std::cout <<at
<1>(l) << std::endl;
-T0...TN
+T0 ...TN
|
Element types | unspecified-type |
L()
L(e0, e1,...
+ en)
e0
...en
.
L(s)
s
.
l =
+ s
l
, from
a Forward
- Sequence, s.s
.
at
<N>(l)
at
.
- at<n>(l) is
+
is
provided for convenience and compatibility with the original Boost.Tuple
- library, despite list being
+ library, despite at
<n>(l)list
being
a Forward Sequence
- only (at is supposed to be a at
is supposed to be a Random
- Access Sequence requirement). The runtime complexity of at is constant (see Recursive
+ Access Sequence requirement). The runtime complexity of at
is constant (see Recursive
Inlined Functions).
list<int, float> l(12, 5.5f); -std::cout << at<0>(l) << std::endl; -std::cout << at<1>(l) << std::endl; +std::cout <<at
<0>(l) << std::endl; +std::cout <<at
<1>(l) << std::endl;
-T0...TN
+T0 ...TN
|
Element types | unspecified-type |
Notation
M
map
type
m
map
e0
...en
fusion::pair
)
s
M()
M(e0, e1,...
+ en)
e0
...en
.
M(s)
s
.
m =
+ s
m
, from
a Forward
- Sequence s.s
.
typedef map< - pair<int, char> - , pair<double, std::string> > +pair
<int, char> + ,pair
<double, std::string> > map_type; map_type m( - make_pair<int>('X') - , make_pair<double>("Men")); +make_pair
<int>('X') + ,make_pair
<double>("Men")); -std::cout << at<int>(m) << std::endl; -std::cout << at<double>(m) << std::endl; +std::cout <<at
<int>(m) << std::endl; +std::cout <<at
<double>(m) << std::endl;
-T0...TN
+T0 ...TN
|
Element types | unspecified-type |
Notation
S
set
type
s
set
e0
...en
fs
S()
S(e0, e1,...
+ en)
e0
...en
.
S(fs)
fs
.
s =
+ fs
s
, from
a Forward
- Sequence fs.fs
.
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; +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;
-T0...TN
+T0 ...TN
|
Element types | unspecified |
V()
V(e0, e1,...
+ en)
e0
...en
.
V(s)
s
.
v =
+ s
v
, from
a Forward
- Sequence, s.s
.
vector<int, float> v(12, 5.5f); -std::cout << at_c<0>(v) << std::endl; -std::cout << at_c<1>(v) << std::endl; +std::cout <<at_c
<0>(v) << std::endl; +std::cout <<at_c
<1>(v) << std::endl;
Description | |||
---|---|---|---|
seq | +seq |
An instance of Sequence | The sequence to convert. |
- Return type: result_of::as_list<Sequence>::type
+ Return type: result_of::as_list
<Sequence>::type
- Semantics: Convert a fusion sequence,
- seq, to a list.
+ Semantics: Convert a fusion sequence,
+ seq
, to a list
.
#include <boost/fusion/sequence/conversion/as_list.hpp>
-as_list(make_vector('x', 123, "hello"))
+as_list(make_vector
('x', 123, "hello"))
Description | |||
---|---|---|---|
seq | +seq |
An instance of Sequence | The sequence to convert. |
- Return type: result_of::as_map<Sequence>::type
+ Return type: result_of::as_map
<Sequence>::type
- Semantics: Convert a fusion sequence,
- seq, to a map.
+ Semantics: Convert a fusion sequence,
+ seq
, to a map
.
- Precondition: The elements of the sequence
+ Precondition: The elements of the sequence
are assumed to be __fusionpair_s.
- There may be no duplicate fusion::pair key types.
+ There may be no duplicate fusion::pair
key types.
#include <boost/fusion/sequence/conversion/as_map.hpp>
-as_map(make_vector( - make_pair<int>('X') - , make_pair<double>("Men"))) +as_map(make_vector
( +make_pair
<int>('X') + ,make_pair
<double>("Men")))
Description | |||
---|---|---|---|
seq | +seq |
An instance of Sequence | The sequence to convert. |
- Return type: result_of::as_set<Sequence>::type
+ Return type: result_of::as_set
<Sequence>::type
- Semantics: Convert a fusion sequence,
- seq, to a set.
+ Semantics: Convert a fusion sequence,
+ seq
, to a set
.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/conversion/as_set.hpp>
-as_set(make_vector('x', 123, "hello"))
+as_set(make_vector
('x', 123, "hello"))
Description | |||
---|---|---|---|
seq | +seq |
An instance of Sequence | The sequence to convert. |
- Return type: result_of::as_vector<Sequence>::type
+ Return type: result_of::as_vector
<Sequence>::type
- Semantics: Convert a fusion sequence,
- seq, to a vector.
+ Semantics: Convert a fusion sequence,
+ seq
, to a vector
.
#include <boost/fusion/sequence/conversion/as_vector.hpp>
-as_vector(make_list('x', 123, "hello"))
+as_vector(make_list
('x', 123, "hello"))
Description | ||
---|---|---|
Sequence | +Sequence |
A fusion Sequence | @@ -65,7 +65,7 @@
- Return type: A list with same elements as the
- input sequence, Sequence.
+ Return type: A list
with same elements as the
+ input sequence, Sequence
.
- Semantics: Convert a fusion sequence,
- Sequence, to a list.
+ Semantics: Convert a fusion sequence,
+ Sequence
, to a list
.
#include <boost/fusion/sequence/conversion/as_list.hpp>
-result_of::as_list<vector<char, int> >::type
+result_of::as_list<vector
<char, int> >::type
Description | ||
---|---|---|
Sequence | +Sequence |
A fusion Sequence | @@ -65,7 +65,7 @@
- Return type: A map with same elements as the
- input sequence, Sequence.
+ Return type: A map
with same elements as the
+ input sequence, Sequence
.
- Semantics: Convert a fusion sequence,
- Sequence, to a map.
+ Semantics: Convert a fusion sequence,
+ Sequence
, to a map
.
- Precondition: The elements of the sequence
+ Precondition: The elements of the sequence
are assumed to be __fusionpair_s.
- There may be no duplicate fusion::pair key types.
+ There may be no duplicate fusion::pair
key types.
#include <boost/fusion/sequence/conversion/as_map.hpp>
-result_of::as_map<vector< - fusion::pair<int, char> - , fusion::pair<double, std::string> > >::type +result_of::as_map<vector
< +fusion::pair
<int, char> + ,fusion::pair
<double, std::string> > >::type
Description | ||
---|---|---|
Sequence | +Sequence |
A fusion Sequence | @@ -65,7 +65,7 @@
- Return type: A set with same elements as the
- input sequence, Sequence.
+ Return type: A set
with same elements as the
+ input sequence, Sequence
.
- Semantics: Convert a fusion sequence,
- Sequence, to a set.
+ Semantics: Convert a fusion sequence,
+ Sequence
, to a set
.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/conversion/as_set.hpp>
-result_of::as_set<vector<char, int> >::type
+result_of::as_set<vector
<char, int> >::type
Description | ||
---|---|---|
Sequence | +Sequence |
A fusion Sequence | @@ -65,7 +65,7 @@
- Return type: A vector with same elements as
- the input sequence, Sequence.
+ Return type: A vector
with same elements as
+ the input sequence, Sequence
.
- Semantics: Convert a fusion sequence,
- Sequence, to a vector.
+ Semantics: Convert a fusion sequence,
+ Sequence
, to a vector
.
#include <boost/fusion/sequence/conversion/as_vector.hpp>
-result_of::as_vector<list<char, int> >::type
+result_of::as_vector<list
<char, int> >::type
Description | |||
---|---|---|---|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to list_tie
+ arguments to list_tie
|
- Return type: list<T0&, T1&,...
+ Return type: list
<T0&, T1&,...
TN&>
- Semantics: Create a list of references from x0, x1,... xN.
+ Semantics: Create a list
of references from x0, x1,... xN
.
#include <boost/fusion/sequence/generation/list_tie.hpp>
diff --git a/doc/html/fusion/sequences/generation/functions/make_cons.html b/doc/html/fusion/sequences/generation/functions/make_cons.html index 2ebc58db..8b1759d4 100644 --- a/doc/html/fusion/sequences/generation/functions/make_cons.html +++ b/doc/html/fusion/sequences/generation/functions/make_cons.html @@ -3,7 +3,7 @@make_cons - + @@ -26,29 +26,29 @@- + Description
- Create a cons from car - (head) and optional cdr + Create a
cons
fromcar
+ (head) and optionalcdr
(tail).- + Synopsis
template <typename Car> -typename result_of::make_cons<Car>::type +typenameresult_of::make_cons
<Car>::type make_cons(Car const& car); template <typename Car, typename Cdr> -typename result_of::make_cons<Car, Cdr>::type +typenameresult_of::make_cons
<Car, Cdr>::type make_cons(Car const& car, Cdr const& cdr);- + Parameters
@@ -64,17 +64,17 @@
- car +car
Instance - of Car + of Car
The list's head - cdr +cdr
Instance - of Cdr + of Cdr
The list's tail (optional) @@ -82,7 +82,7 @@- + Expression Semantics
@@ -90,34 +90,34 @@ make_cons(car, cdr);
- Return type: result_of::make_cons<Car, Cdr>::type or result_of::make_cons<Car>::type
+ Return type: result_of::make_cons
<Car, Cdr>::type
or result_of::make_cons
<Car>::type
- Semantics: Create a cons from car
- (head) and optional cdr
+ Semantics: Create a cons
from car
+ (head) and optional cdr
(tail).
#include <boost/fusion/sequence/generation/make_cons.hpp>
make_cons('x', make_cons(123))
- boost::ref
+ boost::ref
Description | |||
---|---|---|---|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to make_list
+ arguments to make_list
|
- Return type: result_of::make_list<T0, T1,... TN>::type
+ Return type: result_of::make_list
<T0, T1,... TN>::type
- Semantics: Create a list from x0, x1,... xN.
+ Semantics: Create a list
from x0, x1,... xN
.
#include <boost/fusion/sequence/generation/make_list.hpp>
make_list(123, "hello", 12.5)
- boost::ref
+ boost::ref
K0,
+ |
+ KNK0,
K1,...
- KN |
The key types | -Keys associated with x0, x1,... xN + | Keys associated with x0, x1,... xN
|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to make_map
+ arguments to make_map
|
- Return type: result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type
+ Return type: result_of::make_map
<K0, K0,... KN, T0, T1,... TN>::type
- Semantics: Create a map from K0, K1,... KN
- keys and x0,
+ Semantics: Create a map
from K0, K1,... KN
+ keys and x0,
x1,...
- xN
data.
+ xN data.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/generation/make_map.hpp>
make_map( - make_pair<int>('X') - , make_pair<double>("Men")) +make_pair
<int>('X') + ,make_pair
<double>("Men"))
- boost::ref,
- fusion::pair
+ boost::ref
,
+ fusion::pair
- Create a set from one or more values.
+ Create a set
from one or more values.
template <typename T0, typename T1,... typename TN>
-typename result_of::make_set<T0, T1,... TN>::type
+typename result_of::make_set
<T0, T1,... TN>::type
make_set(T0 const& x0, T1 const& x1... TN const& xN);
- The variadic function accepts 0
- to FUSION_MAX_VECTOR_SIZE
- [9]
- elements, where FUSION_MAX_VECTOR_SIZE
- is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant
- FUSION_MAX_VECTOR_SIZE
+ The variadic function accepts 0
+ to FUSION_MAX_VECTOR_SIZE
+ [9]
+ elements, where FUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to 10
. You may define the preprocessor constant
+ FUSION_MAX_VECTOR_SIZE
before including any Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20
Description | |||
---|---|---|---|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to make_set
+ arguments to make_set
|
- Return type: result_of::make_set<T0, T1,... TN>::type
+ Return type: result_of::make_set
<T0, T1,... TN>::type
- Semantics: Create a set from x0, x1,... xN.
+ Semantics: Create a set
from x0, x1,... xN
.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/generation/make_set.hpp>
make_set(123, "hello", 12.5)
- boost::ref
+ boost::ref
- Create a vector from one or more values.
+ Create a vector
from one or more values.
template <typename T0, typename T1,... typename TN>
-typename result_of::make_vector<T0, T1,... TN>::type
+typename result_of::make_vector
<T0, T1,... TN>::type
make_vector(T0 const& x0, T1 const& x1... TN const& xN);
- The variadic function accepts 0
- to FUSION_MAX_VECTOR_SIZE
- elements, where FUSION_MAX_VECTOR_SIZE
- is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant
- FUSION_MAX_VECTOR_SIZE
+ The variadic function accepts 0
+ to FUSION_MAX_VECTOR_SIZE
+ elements, where FUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to 10
. You may define the preprocessor constant
+ FUSION_MAX_VECTOR_SIZE
before including any Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20
Description | |||
---|---|---|---|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to make_vector
+ arguments to make_vector
|
- Return type: result_of::make_vector<T0, T1,... TN>::type
+ Return type: result_of::make_vector
<T0, T1,... TN>::type
- Semantics: Create a vector from x0, x1,... xN.
+ Semantics: Create a vector
from x0, x1,... xN
.
#include <boost/fusion/sequence/generation/make_vector.hpp>
make_vector(123, "hello", 12.5)
- boost::ref
+ boost::ref
Description | |||
---|---|---|---|
x0,
+ |
+ xNx0,
x1,...
- xN |
Instances
- of T0,
+ of T0,
T1,...
- TN
+ TN
|
The
- arguments to vector_tie
+ arguments to vector_tie
|
- Return type: vector<T0&, T1&,...
+ Return type: vector
<T0&, T1&,...
TN&>
- Semantics: Create a vector of references from x0, x1,... xN.
+ Semantics: Create a vector
of references from x0, x1,... xN
.
#include <boost/fusion/sequence/generation/vector_tie.hpp>
diff --git a/doc/html/fusion/sequences/generation/metafunctions.html b/doc/html/fusion/sequences/generation/metafunctions.html index 45216962..f8d07677 100644 --- a/doc/html/fusion/sequences/generation/metafunctions.html +++ b/doc/html/fusion/sequences/generation/metafunctions.html @@ -3,7 +3,7 @@MetaFunctions - + diff --git a/doc/html/fusion/sequences/generation/metafunctions/list_tie.html b/doc/html/fusion/sequences/generation/metafunctions/list_tie.html index 414be87f..003e5ede 100644 --- a/doc/html/fusion/sequences/generation/metafunctions/list_tie.html +++ b/doc/html/fusion/sequences/generation/metafunctions/list_tie.html @@ -3,7 +3,7 @@list_tie - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of list_tie. + Returns the result type of
list_tie
.- + Synopsis
@@ -41,18 +41,18 @@ struct list_tie;- The variadic function accepts 0 - to FUSION_MAX_LIST_SIZE - elements, where FUSION_MAX_LIST_SIZE - is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant - FUSION_MAX_LIST_SIZE + The variadic function accepts
0
+ toFUSION_MAX_LIST_SIZE
+ elements, whereFUSION_MAX_LIST_SIZE
+ is a user definable predefined maximum that defaults to10
. 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- + Parameters
@@ -67,17 +67,17 @@
Description - T0, + + TN T0, T1,... - TN
Any type -The arguments to list_tie + The arguments to list_tie
- + Expression Semantics
@@ -85,21 +85,21 @@ result_of::list_tie<T0, T1,... TN>::type;
- Return type: list<T0&, T1&,...
+ Return type: list
<T0&, T1&,...
TN&>
- Semantics: Create a list of references from T0, T1,... TN.
+ Semantics: Create a list
of references from T0, T1,... TN
.
#include <boost/fusion/sequence/generation/list_tie.hpp>
diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_cons.html b/doc/html/fusion/sequences/generation/metafunctions/make_cons.html index 58957889..e7e9865d 100644 --- a/doc/html/fusion/sequences/generation/metafunctions/make_cons.html +++ b/doc/html/fusion/sequences/generation/metafunctions/make_cons.html @@ -3,7 +3,7 @@make_cons - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of make_cons. + Returns the result type of
make_cons
.- + Synopsis
@@ -41,7 +41,7 @@ struct make_cons;- + Parameters
@@ -57,15 +57,15 @@
- Car +Car
Any type The list's head type - Cdr +Cdr
A - cons + cons
The list's tail type (optional) @@ -73,7 +73,7 @@- + Expression Semantics
@@ -81,24 +81,24 @@ result_of::make_cons<Car, Cdr>::type
- Return type: A cons with head element, Car, of type converted following the
+ Return type: A cons
with head element, Car
, of type converted following the
rules for element
- conversion, and tail, Cdr.
+ conversion, and tail, Cdr
.
- Semantics: Create a cons from Car
- (head) and optional Cdr
+ Semantics: Create a cons
from Car
+ (head) and optional Cdr
(tail).
#include <boost/fusion/sequence/generation/make_cons.hpp>
diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_list.html b/doc/html/fusion/sequences/generation/metafunctions/make_list.html index 72e0076d..bc2b6d5c 100644 --- a/doc/html/fusion/sequences/generation/metafunctions/make_list.html +++ b/doc/html/fusion/sequences/generation/metafunctions/make_list.html @@ -3,7 +3,7 @@make_list - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of make_list. + Returns the result type of
make_list
.- + Synopsis
@@ -41,18 +41,18 @@ struct make_list;- The variadic function accepts 0 - to FUSION_MAX_LIST_SIZE - elements, where FUSION_MAX_LIST_SIZE - is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant - FUSION_MAX_LIST_SIZE + The variadic function accepts
0
+ toFUSION_MAX_LIST_SIZE
+ elements, whereFUSION_MAX_LIST_SIZE
+ is a user definable predefined maximum that defaults to10
. 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- + Parameters
@@ -67,17 +67,17 @@
Description - T0, + + TN T0, T1,... - TN
Any type -Template arguments to make_list + Template arguments to make_list
- + Expression Semantics
@@ -85,22 +85,22 @@ result_of::make_list<T0, T1,... TN>::type
- Return type: A list with elements of types
+ Return type: A list
with elements of types
converted following the rules for element
conversion.
- Semantics: Create a list from T0, T1,... TN.
+ Semantics: Create a list
from T0, T1,... TN
.
#include <boost/fusion/sequence/generation/make_list.hpp>
diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_map.html b/doc/html/fusion/sequences/generation/metafunctions/make_map.html index d5a34ca3..881dd3f4 100644 --- a/doc/html/fusion/sequences/generation/metafunctions/make_map.html +++ b/doc/html/fusion/sequences/generation/metafunctions/make_map.html @@ -3,7 +3,7 @@make_map - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of make_map. + Returns the result type of
make_map
.- + Synopsis
@@ -43,19 +43,19 @@ struct make_map;- The variadic function accepts 0 - to FUSION_MAX_VECTOR_SIZE - [13] - elements, where FUSION_MAX_VECTOR_SIZE - is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant - FUSION_MAX_VECTOR_SIZE + The variadic function accepts
0
+ toFUSION_MAX_VECTOR_SIZE
+ [13] + elements, whereFUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to10
. 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- + Parameters
@@ -71,27 +71,27 @@
- K0, + + KN K0, K1,... - KN
Any type -Keys associated with T0, T1,... TN + Keys associated with T0, T1,... TN
- T0, + + TN T0, T1,... - TN
Any type -Data associated with keys K0, K1,... KN + Data associated with keys K0, K1,... KN
- + Expression Semantics
@@ -99,44 +99,44 @@ resulf_of::make_map<K0, K1,... KN, T0, T1,... TN>::type;
- Return type: result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type
+ Return type: result_of::make_map
<K0, K0,... KN, T0, T1,... TN>::type
- Semantics: A map with fusion::pair elements where the second_type is converted following
+ Semantics: A map
with fusion::pair
elements where the second_type
is converted following
the rules for element
conversion.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/generation/make_map.hpp>
result_of::make_map<int, double, char, double>::type
- Returns the result type of make_set.
+ Returns the result type of make_set
.
@@ -41,19 +41,19 @@ struct make_set;
- The variadic function accepts 0
- to FUSION_MAX_VECTOR_SIZE
- [12]
- elements, where FUSION_MAX_VECTOR_SIZE
- is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant
- FUSION_MAX_VECTOR_SIZE
+ The variadic function accepts 0
+ to FUSION_MAX_VECTOR_SIZE
+ [12]
+ elements, where FUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to 10
. You may define the preprocessor constant
+ FUSION_MAX_VECTOR_SIZE
before including any Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20
Description | ||||
---|---|---|---|---|
T0,
+ |
+ TNT0,
T1,...
- TN |
Any type | -The arguments to make_set + | The arguments to make_set
|
- Return type: A set with elements of types converted
+ Return type: A set
with elements of types converted
following the rules for element
conversion.
- Semantics: Create a set from T0, T1,... TN.
+ Semantics: Create a set
from T0, T1,... TN
.
- Precondition: There may be no duplicate + Precondition: There may be no duplicate key types.
#include <boost/fusion/sequence/generation/make_set.hpp>
@@ -113,9 +113,9 @@
- Returns the result type of make_vector.
+ Returns the result type of make_vector
.
@@ -41,18 +41,18 @@ struct make_vector;
- The variadic function accepts 0
- to FUSION_MAX_VECTOR_SIZE
- elements, where FUSION_MAX_VECTOR_SIZE
- is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant
- FUSION_MAX_VECTOR_SIZE
+ The variadic function accepts 0
+ to FUSION_MAX_VECTOR_SIZE
+ elements, where FUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to 10
. You may define the preprocessor constant
+ FUSION_MAX_VECTOR_SIZE
before including any Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20
Description | ||||
---|---|---|---|---|
T0,
+ |
+ TNT0,
T1,...
- TN |
Any type | -Template arguments to make_vector + | Template arguments to make_vector
|
- Return type: A vector with elements of types
+ Return type: A vector
with elements of types
converted following the rules for element
conversion.
- Semantics: Create a vector from T0, T1,... TN.
+ Semantics: Create a vector
from T0, T1,... TN
.
#include <boost/fusion/sequence/generation/make_list.hpp>
diff --git a/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html b/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html index 241fd60f..b914d310 100644 --- a/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html +++ b/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html @@ -3,7 +3,7 @@vector_tie - + @@ -26,14 +26,14 @@- + Description
- Returns the result type of vector_tie. + Returns the result type of
vector_tie
.- + Synopsis
@@ -41,18 +41,18 @@ struct vector_tie;- The variadic function accepts 0 - to FUSION_MAX_VECTOR_SIZE - elements, where FUSION_MAX_VECTOR_SIZE - is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant - FUSION_MAX_VECTOR_SIZE + The variadic function accepts
0
+ toFUSION_MAX_VECTOR_SIZE
+ elements, whereFUSION_MAX_VECTOR_SIZE
+ is a user definable predefined maximum that defaults to10
. 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- + Parameters
@@ -67,17 +67,17 @@
Description - T0, + + TN T0, T1,... - TN
Any type -The arguments to vector_tie + The arguments to vector_tie
- + Expression Semantics
@@ -85,21 +85,21 @@ result_of::vector_tie<T0, T1,... TN>::type;
- Return type: vector<T0&, T1&,...
+ Return type: vector
<T0&, T1&,...
TN&>
- Semantics: Create a vector of references from T0, T1,... TN.
+ Semantics: Create a vector
of references from T0, T1,... TN
.
#include <boost/fusion/sequence/generation/vector_tie.hpp>
diff --git a/doc/html/fusion/sequences/intrinsics.html b/doc/html/fusion/sequences/intrinsics.html index 605e3f5f..786e6747 100644 --- a/doc/html/fusion/sequences/intrinsics.html +++ b/doc/html/fusion/sequences/intrinsics.html @@ -3,7 +3,7 @@Intrinsics - + @@ -32,11 +32,11 @@ Intrinsic functions, unlike Algorithms, are not generic across the full Sequence repertoire. They need to be implemented for each Fusion Sequence - [5] + [5] .- + Header
@@ -44,7 +44,7 @@diff --git a/doc/html/fusion/sequences/intrinsics/functions/at_key.html b/doc/html/fusion/sequences/intrinsics/functions/at_key.html index 970744d0..5053a3e4 100644 --- a/doc/html/fusion/sequences/intrinsics/functions/at_key.html +++ b/doc/html/fusion/sequences/intrinsics/functions/at_key.html @@ -3,7 +3,7 @@
-diff --git a/doc/html/fusion/sequences/intrinsics/functions/at_c.html b/doc/html/fusion/sequences/intrinsics/functions/at_c.html index 70e3dc17..4a3b3dbd 100644 --- a/doc/html/fusion/sequences/intrinsics/functions/at_c.html +++ b/doc/html/fusion/sequences/intrinsics/functions/at_c.html @@ -3,7 +3,7 @@[5] +
diff --git a/doc/html/fusion/sequences/intrinsics/functions.html b/doc/html/fusion/sequences/intrinsics/functions.html index 4abca708..63da28f7 100644 --- a/doc/html/fusion/sequences/intrinsics/functions.html +++ b/doc/html/fusion/sequences/intrinsics/functions.html @@ -3,7 +3,7 @@[5] In practice, many of intrinsic functions have default implementations that will work in majority of cases
Functions - + diff --git a/doc/html/fusion/sequences/intrinsics/functions/at.html b/doc/html/fusion/sequences/intrinsics/functions/at.html index fdb63ebc..5c737b51 100644 --- a/doc/html/fusion/sequences/intrinsics/functions/at.html +++ b/doc/html/fusion/sequences/intrinsics/functions/at.html @@ -3,7 +3,7 @@at - + @@ -26,27 +26,27 @@- + Description
Returns the N-th element from the beginning of the sequence.
- + Synopsis
template <typename N, typename Sequence> -typename result_of::at<Sequence, N>::type +typenameresult_of::at
<Sequence, N>::type at(Sequence& seq); template <typename N, typename Sequence> -typename result_of::at<Sequence const, N>::type +typenameresult_of::at
<Sequence const, N>::type at(Sequence const& seq);- + Parameters
@@ -62,7 +62,7 @@
- seq +seq
Model of Random @@ -71,7 +71,7 @@ The sequence we wish to investigate. - N +N
An MPL integral constant @@ -81,7 +81,7 @@- + Expression Semantics
@@ -89,38 +89,38 @@ at<N>(seq);- Return type: Returns a reference to - the N-th element from the beginning of the sequence seq - if seq is mutable and - e = - o, where e + Return type: Returns a reference to + the N-th element from the beginning of the sequence
seq
+ ifseq
is mutable and +e = + o
, wheree
is the N-th element from the beginning of the sequence, is a valid expression. Else, returns a type convertable to the N-th element from the beginning of the sequence.- Precondition: 0 - <= N::value < size(s) + Precondition:
0 + <= N::value <
size
(s)- Semantics: Equivalent to + Semantics: Equivalent to
-deref(advance<N>(begin(s))) +deref
(advance
<N>(begin
(s)))- + Header
#include <boost/fusion/sequence/intrinsic/at.hpp>- + Example
-vector<int, int, int> v(1, 2, 3); +vector
<int, int, int> v(1, 2, 3); assert(at<mpl::int_<1> >(v) == 2);at_c - + @@ -26,27 +26,27 @@- + Description
Returns the N-th element from the beginning of the sequence.
- + Synopsis
template <int N, typename Sequence> -typename result_of::at_c<Sequence, N>::type +typenameresult_of::at_c
<Sequence, N>::type at_c(Sequence& seq); template <int N, typename Sequence> -typename result_of::at_c<Sequence const, N>::type +typenameresult_of::at_c
<Sequence const, N>::type at_c(Sequence const& seq);- + Parameters
@@ -62,7 +62,7 @@
- seq +seq
Model of Random @@ -71,7 +71,7 @@ The sequence we wish to investigate. - N +N
An integral constant An index from the beginning of @@ -80,7 +80,7 @@ - + Expression Semantics
@@ -88,39 +88,39 @@ at_c<N>(seq);- Return type: Returns a reference to - the N-th element from the beginning of the sequence seq - if seq is mutable and - e = - o, where e + Return type: Returns a reference to + the N-th element from the beginning of the sequence
seq
+ ifseq
is mutable and +e = + o
, wheree
is the N-th element from the beginning of the sequence, is a valid expression. Else, returns a type convertable to the N-th element from the beginning of the sequence.- Precondition: 0 + Precondition:
0 <= N - < size(s)
+ <size
(s)- Semantics: Equivalent to + Semantics: Equivalent to
-deref(advance<N>(begin(s))) +deref
(advance
<N>(begin
(s)))- + Header
#include <boost/fusion/sequence/intrinsic/at_c.hpp>- + Example
-vector<int, int, int> v(1, 2, 3); +vector
<int, int, int> v(1, 2, 3); assert(at_c<1>(v) == 2);at_key - + @@ -26,27 +26,27 @@- + Description
Returns the element associated with a Key from the sequence.
- + Synopsis
template <typename Key, typename Sequence> -typename result_of::at_key<Sequence, Key>::type +typenameresult_of::at_key
<Sequence, Key>::type at_key(Sequence& seq); template <typename Key, typename Sequence> -typename result_of::at_key<Sequence const, Key>::type +typenameresult_of::at_key
<Sequence const, Key>::type at_key(Sequence const& seq);- + Parameters
@@ -62,7 +62,7 @@
- seq +seq
Model of Associative @@ -71,7 +71,7 @@ The sequence we wish to investigate. - Key +Key
Any type The queried key. @@ -79,7 +79,7 @@- + Expression Semantics
@@ -87,34 +87,34 @@ at_key<Key>(seq);
- Return type: Returns a reference to
- the element associated with Key from the sequence seq
- if seq is mutable and
- e =
- o, where e
+ Return type: Returns a reference to
+ the element associated with Key from the sequence seq
+ if seq
is mutable and
+ e =
+ o
, where e
is the element associated with Key, is a valid expression. Else, returns
a type convertable to the element associated with Key.
- Precondition: has_key<Key>(seq) == true
+ Precondition: has_key<Key>(seq) == true
- Semantics: Returns the element associated + Semantics: Returns the element associated with Key.
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
-set<int, char, bool> s(1, 'x', true);
+set
<int, char, bool> s(1, 'x', true);
assert(at_key<char>(s) == 'x');
diff --git a/doc/html/fusion/sequences/intrinsics/functions/back.html b/doc/html/fusion/sequences/intrinsics/functions/back.html
index 6359c5bd..b9cce96d 100644
--- a/doc/html/fusion/sequences/intrinsics/functions/back.html
+++ b/doc/html/fusion/sequences/intrinsics/functions/back.html
@@ -3,7 +3,7 @@
Returns the last element in the sequence.
template <typename Sequence> -typename result_of::back<Sequence>::type +typenameresult_of::back
<Sequence>::type back(Sequence& seq); template <typename Sequence> -typename result_of::back<Sequence const>::type +typenameresult_of::back
<Sequence const>::type back(Sequence const& seq);
Description | ||
---|---|---|
seq | +seq |
Model of Bidirectional @@ -71,7 +71,7 @@ |
- Return type: Returns a reference to
- the last element in the sequence seq
- if seq is mutable and
- e =
- o, where e
+ Return type: Returns a reference to
+ the last element in the sequence seq
+ if seq
is mutable and
+ e =
+ o
, where e
is the last element in the sequence, is a valid expression. Else, returns
a type convertable to the last element in the sequence.
- Precondition: empty(seq) == false
+ Precondition: empty
(seq) == false
- Semantics: Returns the last element + Semantics: Returns the last element in the sequence.
#include <boost/fusion/sequence/intrinsic/back.hpp>
-vector<int, int, int> v(1, 2, 3);
+vector
<int, int, int> v(1, 2, 3);
assert(back(v) == 3);
diff --git a/doc/html/fusion/sequences/intrinsics/functions/begin.html b/doc/html/fusion/sequences/intrinsics/functions/begin.html
index 152b62cc..4b5ca969 100644
--- a/doc/html/fusion/sequences/intrinsics/functions/begin.html
+++ b/doc/html/fusion/sequences/intrinsics/functions/begin.html
@@ -3,7 +3,7 @@
Returns an iterator pointing to the first element in the sequence.
template <typename Sequence> -typename result_of::begin<Sequence>::type +typenameresult_of::begin
<Sequence>::type begin(Sequence& seq); template <typename Sequence> -typename result_of::begin<Sequence const>::type +typenameresult_of::begin
<Sequence const>::type begin(Sequence const& seq);
Description | ||
---|---|---|
seq | +seq |
Model of Forward @@ -72,7 +72,7 @@ |
- Return type: Return type: Forward
- Iterator if seq
+ Iterator if seq
is a Forward
Sequence else, Bidirectional
- Iterator if seq
+ Iterator if seq
is a Bidirectional
Sequence else, Random
- Access Iterator if seq
+ Access Iterator if seq
is a Random
Access Sequence.
- Semantics: Returns an iterator pointing + Semantics: Returns an iterator pointing to the first element in the sequence.
#include <boost/fusion/sequence/intrinsic/begin.hpp>
-vector<int, int, int> v(1, 2, 3); -assert(deref(begin(v)) == 1); +vector
<int, int, int> v(1, 2, 3); +assert(deref
(begin(v)) == 1);
Description | ||
---|---|---|
seq | +seq |
Model of Forward @@ -69,7 +69,7 @@ |
- Return type: Convertible to bool.
+ Return type: Convertible to bool
.
- Semantics: Evaluates to true if the sequence is empty, else, evaluates
- to false.
+ Semantics: Evaluates to true
if the sequence is empty, else, evaluates
+ to false
.
#include <boost/fusion/sequence/intrinsic/empty.hpp>
-vector<int, int, int> v(1, 2, 3);
+vector
<int, int, int> v(1, 2, 3);
assert(empty(v) == false);
diff --git a/doc/html/fusion/sequences/intrinsics/functions/end.html b/doc/html/fusion/sequences/intrinsics/functions/end.html
index 6b77f893..160f93ac 100644
--- a/doc/html/fusion/sequences/intrinsics/functions/end.html
+++ b/doc/html/fusion/sequences/intrinsics/functions/end.html
@@ -3,7 +3,7 @@
Returns an iterator pointing to one element past the end of the sequence.
template <typename Sequence> -typename result_of::end<Sequence>::type +typenameresult_of::end
<Sequence>::type end(Sequence& seq); template <typename Sequence> -typename result_of::end<Sequence const>::type +typenameresult_of::end
<Sequence const>::type end(Sequence const& seq);
Description | ||
---|---|---|
seq | +seq |
Model of Forward @@ -72,7 +72,7 @@ |
- Return type: Return type: Forward
- Iterator if seq
+ Iterator if seq
is a Forward
Sequence else, Bidirectional
- Iterator if seq
+ Iterator if seq
is a Bidirectional
Sequence else, Random
- Access Iterator if seq
+ Access Iterator if seq
is a Random
Access Sequence.
- Semantics: Returns an iterator pointing + Semantics: Returns an iterator pointing to one element past the end of the sequence.
#include <boost/fusion/sequence/intrinsic/end.hpp>
-vector<int, int, int> v(1, 2, 3); -assert(deref(prior(end(v))) == 3); +vector
<int, int, int> v(1, 2, 3); +assert(deref
(prior
(end(v))) == 3);
Description | ||
---|---|---|
seq | +seq |
Model of Forward @@ -71,7 +71,7 @@ |
- Return type: Returns a reference to
- the first element in the sequence seq
- if seq is mutable and
- e =
- o, where e
+ Return type: Returns a reference to
+ the first element in the sequence seq
+ if seq
is mutable and
+ e =
+ o
, where e
is the first element in the sequence, is a valid expression. Else, returns
a type convertable to the first element in the sequence.
- Precondition: empty(seq) == false
+ Precondition: empty
(seq) == false
- Semantics: Returns the first element + Semantics: Returns the first element in the sequence.
#include <boost/fusion/sequence/intrinsic/front.hpp>
-vector<int, int, int> v(1, 2, 3);
+vector
<int, int, int> v(1, 2, 3);
assert(front(v) == 1);
diff --git a/doc/html/fusion/sequences/intrinsics/functions/has_key.html b/doc/html/fusion/sequences/intrinsics/functions/has_key.html
index 61413303..8225595b 100644
--- a/doc/html/fusion/sequences/intrinsics/functions/has_key.html
+++ b/doc/html/fusion/sequences/intrinsics/functions/has_key.html
@@ -3,7 +3,7 @@
- Returns a type convertible to bool
- that evaluates to true if
+ Returns a type convertible to bool
+ that evaluates to true
if
the sequence contains an element associated with a Key, else, evaluates
- to false.
+ to false
.
template <typename Key, typename Sequence>
-typename result_of::has_key<Sequence, Key>::type
+typename result_of::has_key
<Sequence, Key>::type
has_key(Sequence const& seq);
seq | +seq |
Model of Associative @@ -70,7 +70,7 @@ | The sequence we wish to investigate. |
Key | +Key |
Any type | The queried key. | @@ -78,7 +78,7 @@
- Return type: Convertible to bool.
+ Return type: Convertible to bool
.
- Semantics: Evaluates to true if the sequence contains an element
- associated with Key, else, evaluates to false.
+ Semantics: Evaluates to true
if the sequence contains an element
+ associated with Key, else, evaluates to false
.
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
-set<int, char, bool> s(1, 'x', true);
+set
<int, char, bool> s(1, 'x', true);
assert(has_key<char>(s) == true);
diff --git a/doc/html/fusion/sequences/intrinsics/functions/size.html b/doc/html/fusion/sequences/intrinsics/functions/size.html
index 78f03ec3..69662615 100644
--- a/doc/html/fusion/sequences/intrinsics/functions/size.html
+++ b/doc/html/fusion/sequences/intrinsics/functions/size.html
@@ -3,7 +3,7 @@
- Returns a type convertible to int
+ Returns a type convertible to int
that evaluates the number of elements in the sequence.
template <typename Sequence>
-typename result_of::size<Sequence>::type
+typename result_of::size
<Sequence>::type
size(Sequence const& seq);
Description | ||
---|---|---|
seq | +seq |
Model of Forward @@ -68,7 +68,7 @@ |
- Return type: Convertible to int.
+ Return type: Convertible to int
.
- Semantics: Returns the number of elements + Semantics: Returns the number of elements in the sequence.
#include <boost/fusion/sequence/intrinsic/size.hpp>
-vector<int, int, int> v(1, 2, 3);
+vector
<int, int, int> v(1, 2, 3);
assert(size(v) == 3);
diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions.html b/doc/html/fusion/sequences/intrinsics/metafunctions.html
index 8a7c356b..348a1a5d 100644
--- a/doc/html/fusion/sequences/intrinsics/metafunctions.html
+++ b/doc/html/fusion/sequences/intrinsics/metafunctions.html
@@ -3,7 +3,7 @@
- Returns the result type of at
- [6]
+ Returns the result type of at
+ [6]
.
@@ -48,7 +48,7 @@
};
Table 1.25. Parameters
+Table 1.25. Parameters
Seq | +Seq |
A model of Forward @@ -71,7 +71,7 @@ | Argument sequence |
N | +N |
An MPL Integral Constant | Index of element | @@ -80,7 +80,7 @@
- Return type: Any type. + Return type: Any type.
- Semantics: Returns the result type of
- using at to access the Nth element of Seq.
+ Semantics: Returns the result type of
+ using at
to access the N
th element of Seq
.
#include <boost/fusion/sequence/intrinsic/at.hpp>
-typedef vector<int,float,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::at<vec, boost::mpl::int_<1> >::type, float&>)); +typedefvector
<int,float,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::at
<vec, boost::mpl::int_<1> >::type, float&>));
[6] - result_of::at reflects the actual return - type of the function at. _sequence_s - typically return references to its elements via the at function. If you want - to get the actual element type, use result_of::value_at +
[6]
+ result_of::at
reflects the actual return
+ type of the function at
. _sequence_s
+ typically return references to its elements via the at
function. If you want
+ to get the actual element type, use result_of::value_at
- Returns the result type of at_c
- [7]
+ Returns the result type of at_c
+ [7]
.
@@ -48,7 +48,7 @@
};
Table 1.26. Parameters
+Table 1.26. Parameters
Seq | +Seq |
A model of Forward @@ -71,7 +71,7 @@ | Argument sequence |
M | +M |
Positive integer index | Index of element | @@ -80,7 +80,7 @@
- Return type: Any type + Return type: Any type
- Semantics: Returns the result type of
- using at_c to access the Mth element of Seq.
+ Semantics: Returns the result type of
+ using at_c
to access the M
th element of Seq
.
#include <boost/fusion/sequence/intrinsic/at.hpp>
-typedef vector<int,float,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::at_c<vec, 1>::type, float&>)); +typedefvector
<int,float,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::at_c
<vec, 1>::type, float&>));
[7] - result_of::at_c reflects the actual - return type of the function at_c. _sequence_s - typically return references to its elements via the at_c function. If you want - to get the actual element type, use result_of::value_at_c +
[7]
+ result_of::at_c
reflects the actual
+ return type of the function at_c
. _sequence_s
+ typically return references to its elements via the at_c
function. If you want
+ to get the actual element type, use result_of::value_at_c
- Returns the result type of at_key
- [8]
+ Returns the result type of at_key
+ [8]
.
@@ -48,7 +48,7 @@
};
Table 1.30. Parameters
+Table 1.30. Parameters
Seq | +Seq |
A model of Forward @@ -71,7 +71,7 @@ | Argument sequence |
Key | +Key |
Any type | Key type | @@ -80,7 +80,7 @@
- Return type: Any type. + Return type: Any type.
- Semantics: Returns the result of using
- at_key to access the element
- with key type Key in
- Seq.
+ Semantics: Returns the result of using
+ at_key
to access the element
+ with key type Key
in
+ Seq
.
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
-typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap; -BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char&>)); +typedefmap
<pair
<int, char>,pair
<char, char>,pair
<double, char> > mymap; +BOOST_MPL_ASSERT((boost::is_same<result_of::at_key
<mymap, int>::type, char&>));
[8] - result_of::at_key reflects the actual - return type of the function at_key. _sequence_s - typically return references to its elements via the at_key function. If you - want to get the actual element type, use result_of::value_at_key +
[8]
+ result_of::at_key
reflects the actual
+ return type of the function at_key
. _sequence_s
+ typically return references to its elements via the at_key
function. If you
+ want to get the actual element type, use result_of::value_at_key
- Returns the result type of back.
+ Returns the result type of back
.
@@ -44,7 +44,7 @@
};
Table 1.23. Parameters
+Table 1.23. Parameters
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: Any type + Return type: Any type
- Semantics: The type returned by dereferencing
- an iterator to the last element in the sequence. Equivalent to result_of::deref<result_of::prior<result_of::end<Seq>::type>::type>::type.
+ Semantics: The type returned by dereferencing
+ an iterator to the last element in the sequence. Equivalent to
.
result_of::deref
<result_of::prior
<result_of::end
<Seq>::type>::type>::type
#include <boost/fusion/sequence/intrinsic/back.hpp>
-typedef vector<int,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::back<vec>::type, char&>)); +typedefvector
<int,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::back
<vec>::type, char&>));
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: An iterator modelling the
- same traversal concept as Seq.
+ Return type: An iterator modelling the
+ same traversal concept as Seq
.
- Semantics: Returns the type of an iterator
- to the first element of Seq.
+ Semantics: Returns the type of an iterator
+ to the first element of Seq
.
#include <boost/fusion/sequence/intrinsic/begin.hpp>
-typedef vector<int> vec; -typedef result_of::begin<vec>::type it; -BOOST_MPL_ASSERT((boost::is_same<result_of::deref<it>::type, int&>)) +typedefvector
<int> vec; +typedefresult_of::begin
<vec>::type it; +BOOST_MPL_ASSERT((boost::is_same<result_of::deref
<it>::type, int&>))
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: An MPL Integral Constant + Return type: An MPL Integral Constant
- Semantics: Returns mpl::true_
- if Seq has zero elements,
- mpl::false_ otherwise.
+ Semantics: Returns mpl::true_
+ if Seq
has zero elements,
+ mpl::false_
otherwise.
#include <boost/fusion/sequence/intrinsic/empty.hpp>
-typedef vector<> empty_vec; -typedef vector<int,float,char> vec; +typedefvector
<> empty_vec; +typedefvector
<int,float,char> vec; -BOOST_MPL_ASSERT((result_of::empty<empty_vec>)); -BOOST_MPL_ASSERT_NOT((result_of::empty<vec>)); +BOOST_MPL_ASSERT((result_of::empty
<empty_vec>)); +BOOST_MPL_ASSERT_NOT((result_of::empty
<vec>));
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: A model of the same traversal
- concept as Seq.
+ Return type: A model of the same traversal
+ concept as Seq
.
- Semantics: Returns the type of an iterator
- one past the end of Seq.
+ Semantics: Returns the type of an iterator
+ one past the end of Seq
.
#include <boost/fusion/sequence/intrinsic/end.hpp>
-typedef vector<int> vec; -typedef result_of::prior<result_of::end<vec>::type>::type first; -BOOST_MPL_ASSERT((result_of::equal_to<first, result_of::begin<vec>::type>)) +typedefvector
<int> vec; +typedefresult_of::prior
<result_of::end
<vec>::type>::type first; +BOOST_MPL_ASSERT((result_of::equal_to
<first,result_of::begin
<vec>::type>))
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: Any type + Return type: Any type
- Semantics: The type returned by dereferencing
- an iterator to the first element in Seq.
- Equivalent to result_of::deref<result_of::begin<Seq>::type>::type.
+ Semantics: The type returned by dereferencing
+ an iterator to the first element in Seq
.
+ Equivalent to
.
result_of::deref
<result_of::begin
<Seq>::type>::type
#include <boost/fusion/sequence/intrinsic/front.hpp>
-typedef vector<int,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::front<vec>::type, int&>)); +typedefvector
<int,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::front
<vec>::type, int&>));
Seq | +Seq |
A model of Forward @@ -69,7 +69,7 @@ | Argument sequence |
Key | +Key |
Any type | Key type | @@ -78,7 +78,7 @@
- Return type: An MPL Integral Constant. + Return type: An MPL Integral Constant.
- Semantics: Returns mpl::true_
- if Seq contains an element
- with key type Key, returns
- mpl::false_ otherwise.
+ Semantics: Returns mpl::true_
+ if Seq
contains an element
+ with key type Key
, returns
+ mpl::false_
otherwise.
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
-typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap; -BOOST_MPL_ASSERT((result_of::has_key<mymap, int>)); -BOOST_MPL_ASSERT_NOT((result_of::has_key<mymap, void*>)); +typedefmap
<pair
<int, char>,pair
<char, char>,pair
<double, char> > mymap; +BOOST_MPL_ASSERT((result_of::has_key
<mymap, int>)); +BOOST_MPL_ASSERT_NOT((result_of::has_key
<mymap, void*>));
Description | ||
---|---|---|
Seq | +Seq |
A model of Forward @@ -68,7 +68,7 @@ |
- Return type: An MPL Integral Constant. + Return type: An MPL Integral Constant.
- Semantics: Returns the number of elements
- in Seq.
+ Semantics: Returns the number of elements
+ in Seq
.
#include <boost/fusion/sequence/intrinsic/size.hpp>
-typedef vector<int,float,char> vec; -typedef result_of::size<vec>::type size_mpl_integral_constant; +typedefdiff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html index d6d28373..1ee056b3 100644 --- a/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html @@ -3,7 +3,7 @@vector
<int,float,char> vec; +typedefresult_of::size
<vec>::type size_mpl_integral_constant; BOOST_MPL_ASSERT_RELATION(size_mpl_integral_constant::value, ==, 3);
Returns the actual type at a given index from the Sequence.
@@ -46,7 +46,7 @@
};
Table 1.27. Parameters
+Table 1.27. Parameters
Seq | +Seq |
A model of Forward @@ -69,7 +69,7 @@ | Argument sequence |
N | +N |
An MPL Integral Constant | Index of element | @@ -78,7 +78,7 @@
- Return type: Any type. + Return type: Any type.
- Semantics: Returns the actual type at
- the Nth element of Seq.
+ Semantics: Returns the actual type at
+ the N
th element of Seq
.
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
-typedef vector<int,float,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_at<vec, boost::mpl::int_<1> >::type, float>)); +typedefvector
<int,float,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::value_at
<vec, boost::mpl::int_<1> >::type, float>));
Seq | +Seq |
A model of Forward @@ -69,7 +69,7 @@ | Argument sequence |
M | +M |
Positive integer index | Index of element | @@ -78,7 +78,7 @@
- Return type: Any type + Return type: Any type
- Semantics: Returns the actual type at
- the Mth element of Seq.
+ Semantics: Returns the actual type at
+ the M
th element of Seq
.
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
-typedef vector<int,float,char> vec; -BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_c<vec, 1>::type, float>)); +typedefvector
<int,float,char> vec; +BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_c
<vec, 1>::type, float>));
Seq | +Seq |
A model of Forward @@ -69,7 +69,7 @@ | Argument sequence |
Key | +Key |
Any type | Key type | @@ -78,7 +78,7 @@
- Return type: Any type. + Return type: Any type.
- Semantics: Returns the actual element
- type associated with key type Key
- in Seq.
+ Semantics: Returns the actual element
+ type associated with key type Key
+ in Seq
.
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
-typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap; -BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char>)); +typedefmap
<pair
<int, char>,pair
<char, char>,pair
<double, char> > mymap; +BOOST_MPL_ASSERT((boost::is_same<result_of::at_key
<mymap, int>::type, char>));
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -68,7 +68,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a == b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a == b
is a valid expression returning a
type that is convertible to bool.
@@ -93,30 +93,30 @@ compile time error.
- Semantics: + Semantics:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, e1 == e2 returns true. For any 2 zero length
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, e1 == e2
returns true. For any 2 zero length
_sequence_s, e and f, e == f returns
true.
#include <boost/fusion/sequence/comparison/equal_to.hpp>
-vector<int, char> v1(5, 'a'); -vector<int, char> v2(5, 'a'); +diff --git a/doc/html/fusion/sequences/operators/comparison/greater_than.html b/doc/html/fusion/sequences/operators/comparison/greater_than.html index b6a913fe..10187349 100644 --- a/doc/html/fusion/sequences/operators/comparison/greater_than.html +++ b/doc/html/fusion/sequences/operators/comparison/greater_than.html @@ -4,7 +4,7 @@vector
<int, char> v1(5, 'a'); +vector
<int, char> v2(5, 'a'); assert(v1 == v2);
@@ -43,7 +43,7 @@ operator>(Seq1 const& a, Seq2 const& b);
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -68,7 +68,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a < b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a < b
is a valid expression returning a
type that is convertible to bool.
@@ -93,23 +93,23 @@ compile time error.
- Semantics: Returns b < a. + Semantics: Returns b < a.
#include <boost/fusion/sequence/comparison/less_equal.hpp>
-vector<int, float> v1(4, 3.3f); -vector<short, float> v2(5, 3.3f); -vector<long, double> v3(5, 4.4); +diff --git a/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html b/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html index 2105bda5..b4cdbf9f 100644 --- a/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html +++ b/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html @@ -4,7 +4,7 @@vector
<int, float> v1(4, 3.3f); +vector
<short, float> v2(5, 3.3f); +vector
<long, double> v3(5, 4.4); assert(v2 > v1); assert(v3 > v2);
@@ -42,7 +42,7 @@ operator>=(Seq1 const& a, Seq2 const& b);
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -67,7 +67,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a < b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a < b
is a valid expression returning a
type that is convertible to bool.
@@ -92,23 +92,23 @@ compile time error.
- Semantics: Returns !(a < b). + Semantics: Returns !(a < b).
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
-vector<int, float> v1(4, 3.3f); -vector<short, float> v2(5, 3.3f); -vector<long, double> v3(5, 4.4); +diff --git a/doc/html/fusion/sequences/operators/comparison/less_than.html b/doc/html/fusion/sequences/operators/comparison/less_than.html index f4fa9b62..299f685d 100644 --- a/doc/html/fusion/sequences/operators/comparison/less_than.html +++ b/doc/html/fusion/sequences/operators/comparison/less_than.html @@ -4,7 +4,7 @@vector
<int, float> v1(4, 3.3f); +vector
<short, float> v2(5, 3.3f); +vector
<long, double> v3(5, 4.4); assert(v2 >= v1); assert(v3 >= v2);
@@ -43,7 +43,7 @@ operator<(Seq1 const& a, Seq2 const& b);
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -68,7 +68,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a < b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a < b
is a valid expression returning a
type that is convertible to bool.
@@ -93,25 +93,25 @@ compile time error.
- Semantics: Returns the lexicographical
- comparison of between a
- and b.
+ Semantics: Returns the lexicographical
+ comparison of between a
+ and b
.
#include <boost/fusion/sequence/comparison/less.hpp>
-vector<int, float> v1(4, 3.3f); -vector<short, float> v2(5, 3.3f); -vector<long, double> v3(5, 4.4); +diff --git a/doc/html/fusion/sequences/operators/comparison/less_than_equal.html b/doc/html/fusion/sequences/operators/comparison/less_than_equal.html index 1227b615..a4862309 100644 --- a/doc/html/fusion/sequences/operators/comparison/less_than_equal.html +++ b/doc/html/fusion/sequences/operators/comparison/less_than_equal.html @@ -4,7 +4,7 @@vector
<int, float> v1(4, 3.3f); +vector
<short, float> v2(5, 3.3f); +vector
<long, double> v3(5, 4.4); assert(v1 < v2); assert(v2 < v3);
@@ -43,7 +43,7 @@ operator<=(Seq1 const& a, Seq2 const& b);
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -68,7 +68,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a < b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a < b
is a valid expression returning a
type that is convertible to bool.
@@ -93,23 +93,23 @@ compile time error.
- Semantics: Returns !(b < a). + Semantics: Returns !(b < a).
#include <boost/fusion/sequence/comparison/less_equal.hpp>
-vector<int, float> v1(4, 3.3f); -vector<short, float> v2(5, 3.3f); -vector<long, double> v3(5, 4.4); +diff --git a/doc/html/fusion/sequences/operators/comparison/not_equal.html b/doc/html/fusion/sequences/operators/comparison/not_equal.html index 3dd1ee1e..a4c1e8f6 100644 --- a/doc/html/fusion/sequences/operators/comparison/not_equal.html +++ b/doc/html/fusion/sequences/operators/comparison/not_equal.html @@ -4,7 +4,7 @@vector
<int, float> v1(4, 3.3f); +vector
<short, float> v2(5, 3.3f); +vector
<long, double> v3(5, 4.4); assert(v1 <= v2); assert(v2 <= v3);
@@ -42,7 +42,7 @@ operator!=(Seq1 const& a, Seq2 const& b);
Description | ||
---|---|---|
a, - b | +a,
+ b |
Instances of Sequence | @@ -67,7 +67,7 @@
- Return type: bool
+ Return type: bool
- Requirements: + Requirements:
- For each element, e1,
- in sequence a, and for
- each element, e2, in
- sequence b, a == b is a valid expression returning a
+ For each element, e1
,
+ in sequence a
, and for
+ each element, e2
, in
+ sequence b
, a == b
is a valid expression returning a
type that is convertible to bool.
@@ -92,25 +92,25 @@ compile time error.
- Semantics: + Semantics:
Returns !(a == b).
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
-vector<int, char> v3(5, 'b'); -vector<int, char> t4(2, 'a'); +vector
<int, char> v3(5, 'b'); +vector
<int, char> t4(2, 'a'); assert(v1 != v3); assert(v1 != t4); assert(!(v1 != v2)); diff --git a/doc/html/fusion/sequences/operators/i_o.html b/doc/html/fusion/sequences/operators/i_o.html index f81d893a..56a002b4 100644 --- a/doc/html/fusion/sequences/operators/i_o.html +++ b/doc/html/fusion/sequences/operators/i_o.html @@ -3,7 +3,7 @@I/O - + @@ -26,25 +26,25 @@- The I/O operators: << - and >> work generically - on all Fusion sequences. The global operator<< has been overloaded for generic + The I/O operators:
<<
+ and>>
work generically + on all Fusion sequences. The globaloperator<<
has been overloaded for generic output streams such that _sequence_s - are output by recursively calling operator<< for each element. Analogously, - the global operator>> + are output by recursively callingoperator<<
for each element. Analogously, + the globaloperator>>
has been overloaded to extract _sequence_s - from generic input streams by recursively calling operator>> for each element. + from generic input streams by recursively callingoperator>>
for each element.The default delimiter between the elements is space, and the Sequence is enclosed in parenthesis. For Example:
-vector<float, int, std::string> a(1.0f, 2, std::string("Howdy folks!"); +vector
<float, int, std::string> a(1.0f, 2, std::string("Howdy folks!"); cout << a;- outputs the vector as: (1.0 2 Howdy folks!) + outputs the
vector
as: (1.0 2 Howdy folks!)The library defines three manipulators for changing the default behavior: @@ -52,23 +52,23 @@
Manipulators
-
- tuple_open(arg)
+tuple_open(arg)
- Defines the character that is output before the first element.
-- tuple_close(arg)
+tuple_close(arg)
- Defines the character that is output after the last element.
-- tuple_delimiter(arg)
+tuple_delimiter(arg)
- Defines the delimiter character between elements.
- The argument to tuple_open, - tuple_close and tuple_delimiter may be a char, wchar_t, + The argument to
tuple_open
, +tuple_close
andtuple_delimiter
may be achar
,wchar_t
, a C-string, or a wide C-string.@@ -78,12 +78,12 @@ std::cout << tuple_open('[') << tuple_close(']') << tuple_delimiter(", ") << a;
- outputs the same vector, a
+ outputs the same vector
, a
as: [1.0, 2, Howdy folks!]
- The same manipulators work with operator>> and istream
- as well. Suppose the std::cin
+ The same manipulators work with operator>>
and istream
+ as well. Suppose the std::cin
stream contains the following data:
@@ -93,8 +93,8 @@ The code:-vector<int, int, int> i; -vector<int, int> j; +vector
<int, int, int> i; +vector
<int, int> j; std::cin >> i; std::cin >> set_open('[') >> set_close(']') >> set_delimiter(':'); @@ -102,16 +102,16 @@reads the data into the _vector_s - i and j. +
i
andj
.Note that extracting _sequence_s - with std::string or C-style string elements does + with
std::string
or C-style string elements does not generally work, since the streamed Sequence representation may not be unambiguously parseable.- + Header
diff --git a/doc/html/fusion/sequences/operators/i_o/in.html b/doc/html/fusion/sequences/operators/i_o/in.html index dc0b3113..64e8c2f0 100644 --- a/doc/html/fusion/sequences/operators/i_o/in.html +++ b/doc/html/fusion/sequences/operators/i_o/in.html @@ -3,7 +3,7 @@in - + @@ -26,7 +26,7 @@- + Description
@@ -34,7 +34,7 @@ stream.
- + Synopsis
@@ -43,7 +43,7 @@ operator>>(IStream& is, Sequence& seq);- + Parameters
@@ -73,7 +73,7 @@
- + Expression Semantics
@@ -81,26 +81,26 @@ is >> seq- Return type: IStream& + Return type: IStream&
- Semantics: For each element, e, in sequence, seq, - call is >> - e. + Semantics: For each element,
e
, in sequence,seq
, + callis >> + e
.- + Header
#include <boost/fusion/sequence/io/in.hpp>- + Example
-vector<int, std::string, char> v; +diff --git a/doc/html/fusion/sequences/operators/i_o/out.html b/doc/html/fusion/sequences/operators/i_o/out.html index 90ef2446..b8db9e21 100644 --- a/doc/html/fusion/sequences/operators/i_o/out.html +++ b/doc/html/fusion/sequences/operators/i_o/out.html @@ -3,7 +3,7 @@vector
<int, std::string, char> v; std::cin >> v;out - + @@ -26,7 +26,7 @@- + Description
@@ -34,7 +34,7 @@ stream.
- + Synopsis
@@ -43,7 +43,7 @@ operator<<(OStream& os, Sequence& seq);- + Parameters
@@ -73,7 +73,7 @@
- + Expression Semantics
@@ -81,26 +81,26 @@ os << seq
- Return type: OStream& + Return type: OStream&
- Semantics: For each element, e, in sequence, seq,
- call os <<
- e.
+ Semantics: For each element, e
, in sequence, seq
,
+ call os <<
+ e
.
#include <boost/fusion/sequence/io/out.hpp>
-std::cout << make_vector(123, "Hello", 'x') << std::endl;
+std::cout << make_vector
(123, "Hello", 'x') << std::endl;
Sequence | +Sequence |
A Forward @@ -78,16 +78,16 @@ | |
Pred | +Pred |
Unary
- Metafunction returning an mpl::bool_
+ Metafunction returning an mpl::bool_
|
F(s)
filter_view
given
+ a sequence, s
.
F(f)
filter_view
+ from another filter_view
,
+ f
.
f =
+ f2
filter_view
,
+ f
, from another
+ filter_view
, f2
.
@@ -165,7 +165,7 @@ using boost::mpl::not_; using boost::is_class; -typedef vector<std::string, char, long, bool, double> vector_type; +typedefvector
<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); diff --git a/doc/html/fusion/sequences/views/iterator_range.html b/doc/html/fusion/sequences/views/iterator_range.html index 5231f702..8beb71ae 100644 --- a/doc/html/fusion/sequences/views/iterator_range.html +++ b/doc/html/fusion/sequences/views/iterator_range.html @@ -3,7 +3,7 @@iterator_range - + @@ -26,22 +26,22 @@- + Description
- iterator_range presents +
iterator_range
presents a sub-range of its underlying sequence delimited by a pair of iterators.- + Header
#include <boost/fusion/sequence/view/iterator_range.hpp>- + Synopsis
@@ -49,7 +49,7 @@ struct iterator_range;- + Template parameters
@@ -66,14 +66,14 @@
First
Last
IR(f, l)
iterator_range
+ given iterators, f
+ and l
.
IR(ir)
iterator_range
+ from another iterator_range
,
+ ir
.
ir =
+ ir2
iterator_range
,
+ ir
, from another
+ iterator_range
,
+ ir2
.
char const* s = "Ruby"; -typedef vector<int, char, double, char const*> vector_type; +typedefvector
<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; +typedefresult_of::begin
<vector_type>::type A; +typedefresult_of::end
<vector_type>::type B; +typedefresult_of::next
<A>::type C; +typedefresult_of::prior
<B>::type D; C c(vec); D d(vec); diff --git a/doc/html/fusion/sequences/views/joint_view.html b/doc/html/fusion/sequences/views/joint_view.html index 5701f8ab..cb8979ba 100644 --- a/doc/html/fusion/sequences/views/joint_view.html +++ b/doc/html/fusion/sequences/views/joint_view.html @@ -3,7 +3,7 @@joint_view - + @@ -26,22 +26,22 @@- + Description
- joint_view presents a view +
joint_view
presents a view which is a concatenation of two sequences.- + Header
#include <boost/fusion/sequence/view/joint_view.hpp>- + Synopsis
@@ -49,7 +49,7 @@ struct joint_view;- + Template parameters
@@ -66,7 +66,7 @@
Sequence1
Sequence2
JV(s1, s2)
joint_view
given
+ sequences, s1
and
+ s2
.
JV(jv)
joint_view
+ from another joint_view
,
+ jv
.
jv =
+ jv2
joint_view
,
+ jv
, from another
+ joint_view
, jv2
.
-vector<int, char> v1(3, 'x'); -vector<std::string, int> v2("hello", 123); +diff --git a/doc/html/fusion/sequences/views/reverse_view.html b/doc/html/fusion/sequences/views/reverse_view.html index 1c804ba3..006a525a 100644 --- a/doc/html/fusion/sequences/views/reverse_view.html +++ b/doc/html/fusion/sequences/views/reverse_view.html @@ -3,7 +3,7 @@vector
<int, char> v1(3, 'x'); +vector
<std::string, int> v2("hello", 123); joint_view< - vector<int, char> - , vector<std::string, int> +vector
<int, char> + ,vector
<std::string, int> > view(v1, v2); std::cout << view << std::endl;
- reverse_view presents a
+ reverse_view
presents a
reversed view of underlying sequence. The first element will be its last
and the last element will be its first.
#include <boost/fusion/sequence/view/reverse_view.hpp>
@@ -46,7 +46,7 @@ struct reverse_view;
Sequence
RV(s)
reverse_view
+ given sequence, s
.
RV(rv)
reverse_view
+ from another reverse_view
,
+ rv
.
rv =
+ rv2
reverse_view
,
+ rv
, from another
+ reverse_view
, rv2
.
-typedef vector<int, short, double> vector_type; +typedefvector
<int, short, double> vector_type; vector_type vec(2, 5, 3.3); reverse_view<vector_type> reverse(vec); diff --git a/doc/html/fusion/sequences/views/single_view.html b/doc/html/fusion/sequences/views/single_view.html index 9cd016cc..6a0dd254 100644 --- a/doc/html/fusion/sequences/views/single_view.html +++ b/doc/html/fusion/sequences/views/single_view.html @@ -3,7 +3,7 @@single_view - + @@ -26,18 +26,18 @@- single_view is a view into +
single_view
is a view into a value as a single element sequence.- + Header
#include <boost/fusion/sequence/view/single_view.hpp>- + Synopsis
@@ -45,7 +45,7 @@ struct single_view;- + Template parameters
@@ -61,14 +61,14 @@Default
T
S(x)
single_view
from
+ x
.
S(s)
single_view
+ from another single_view
,
+ s
.
s =
+ s2
single_view
,
+ s
, from another
+ single_view
, s2
.
diff --git a/doc/html/fusion/sequences/views/transform_view.html b/doc/html/fusion/sequences/views/transform_view.html index 6d891b9c..1690d8d8 100644 --- a/doc/html/fusion/sequences/views/transform_view.html +++ b/doc/html/fusion/sequences/views/transform_view.html @@ -3,7 +3,7 @@transform_view - + @@ -26,40 +26,40 @@- transform_view presents +
transform_view
presents a transformed view of its underlying sequence given a unary Polymorphic - Function Object. The transform_view + Function Object. Thetransform_view
inherits the traversal characteristics (see Sequence Traversal Concept) of its underlying sequence.- + Header
#include <boost/fusion/sequence/view/transform_view.hpp>- + Synopsis
- Unary Version + Unary Version
template <typename Sequence, typename F> struct transform_view;- Binary Version + Binary Version
template <typename Sequence1, typename Sequence2, typename F> struct transform_view;- + Template parameters
@@ -76,7 +76,7 @@
Sequence
Sequence1
Sequence2
F
Notation
TV
transform_view
type
BTV
transform_view
type
UTV
transform_view
type
f
F
s
Sequence
s1
Sequence1
s2
Sequence2
tv
,
+ tv2
transform_view
UTV(s, f)
transform_view
+ given sequence, s
and unary Polymorphic
- Function Object, f.f
.
BTV(s1, s2, f)
transform_view
+ given sequences, s1
+ and s2
and unary
Polymorphic Function
- Object, f.f
.
TV(tv)
transform_view
+ from another transform_view
,
+ tv
.
tv =
+ tv2
transform_view
,
+ tv
, from another
+ transform_view
,
+ tv2
.
@@ -252,7 +252,7 @@ } }; -typedef vector<int, short, double> vector_type; +typedefvector
<int, short, double> vector_type; vector_type vec(2, 5, 3.3); transform_view<vector_type, square> transform(vec, square()); diff --git a/doc/html/fusion/sequences/views/zip_view.html b/doc/html/fusion/sequences/views/zip_view.html index 8ef18542..ab689851 100644 --- a/doc/html/fusion/sequences/views/zip_view.html +++ b/doc/html/fusion/sequences/views/zip_view.html @@ -3,7 +3,7 @@zip_view - + @@ -26,25 +26,25 @@- + Description
- zip_view presents a view +
zip_view
presents a view which iterates over a collection of _sequence_s - in parallel. A zip_view + in parallel. Azip_view
is constructed from a Sequence of references to the component _sequence_s.- + Header
#include <boost/fusion/sequence/view/zip_view.hpp>- + Synopsis
@@ -52,7 +52,7 @@ struct zip_view;- + Template parameters
@@ -68,7 +68,7 @@Default
Sequences
ZV(s)
zip_view
given
a sequence of references to the component _sequence_s.ZV(zv1)
zip_view
+ from another zip_view
,
+ zv
.
zv1 =
+ zv2
zip_view
, zv
, from another zip_view
, zv2
.
-typedef vector<int,int> vec1; -typedef vector<char,char> vec2; +typedefdiff --git a/doc/html/fusion/support.html b/doc/html/fusion/support.html index 532ba0f4..dfaeb458 100644 --- a/doc/html/fusion/support.html +++ b/doc/html/fusion/support.html @@ -3,7 +3,7 @@vector
<int,int> vec1; +typedefvector
<char,char> vec2; vec1 v1(1,2); vec2 v2('a','b'); -typedef vector<vec1&, vec2&> sequences; +typedefvector
<vec1&, vec2&> sequences; std::cout << zip_view<sequences>(sequences(v1, v2)) << std::endl; // ((1 a) (2 b))
diff --git a/doc/html/fusion/support/category_of.html b/doc/html/fusion/support/category_of.html index 21edf08a..946b613e 100644 --- a/doc/html/fusion/support/category_of.html +++ b/doc/html/fusion/support/category_of.html @@ -3,11 +3,11 @@
@@ -36,7 +36,7 @@ Sequence Concepts).
@@ -50,7 +50,7 @@
}
Description | |||
---|---|---|---|
T | +T |
Any type | The type to query. |
- Return type: + Return type:
For Iterators, the return type is derived from one of: @@ -134,24 +134,24 @@ }}
- Semantics: Establishes the conceptual classification + Semantics: Establishes the conceptual classification of a particular Sequence or Iterator.
#include <boost/fusion/support/category_of.hpp>
using boost::is_base_of; -typedef traits::category_of<list<> >::type list_category; -typedef traits::category_of<vector<> >::type vector_category; +typedef traits::category_of<@@ -162,7 +162,7 @@list
<> >::type list_category; +typedef traits::category_of<vector
<> >::type vector_category; BOOST_MPL_ASSERT(( is_base_of<forward_traversal_tag, list_category> )); BOOST_MPL_ASSERT(( is_base_of<random_access_traversal_tag, vector_category> ));