diff --git a/doc/algorithm.qbk b/doc/algorithm.qbk
index 3fa194b2..e77249d3 100644
--- a/doc/algorithm.qbk
+++ b/doc/algorithm.qbk
@@ -35,9 +35,7 @@ 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 of the original sequence such as associativity of __set__(s).
+sequences are cheaply extensible.
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.
@@ -59,42 +57,59 @@ a sequence repeatedly applying an operation to its elements.
[section Functions]
-[section fold]
-
+[template fold_desc[name result_of_name arg_desc arg_id arg_type_id invoke_desc semantics_elements_desc example_arg_transform example_result I0 I1 IN]
[heading Description]
-For a sequence `seq`, initial state `initial_state`, and binary function object or function pointer `f`, fold returns the result of the repeated application of binary `f` to the result of the previous `f` invocation (`inital_state` if it is the first call) and each element of `seq`.
+For a sequence `seq`, initial state `initial_state`, and binary function object
+or function pointer `f`, [^[name]] returns the result of the repeated application of
+binary `f` to the result of the previous `f` invocation (`inital_state` if it is
+the first call) and [arg_desc] of `seq`.
+[def name_macro [name]]
+[def result_of_name_macro [result_of_name]]
[heading Synopsis]
template<
typename Sequence,
typename State,
typename F
>
- typename __result_of_fold__
#include <boost/fusion/adapted.hpp> diff --git a/doc/html/fusion/adapted/adapt_assoc.html b/doc/html/fusion/adapted/adapt_assoc.html index 50007e41..b9968dab 100644 --- a/doc/html/fusion/adapted/adapt_assoc.html +++ b/doc/html/fusion/adapted/adapt_assoc.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_ASSOC_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT- + Description
@@ -37,7 +37,7 @@ Sequence.
- + Synopsis
BOOST_FUSION_ADAPT_ASSOC_STRUCT( @@ -48,7 +48,7 @@ )- + Semantics
@@ -66,14 +66,14 @@ should be the fully namespace qualified name of the struct to be adapted.
- + Header
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp> #include <boost/fusion/include/adapt_assoc_struct.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/adapt_assoc_struct_named.html b/doc/html/fusion/adapted/adapt_assoc_struct_named.html index e6d9abdc..2a8996cf 100644 --- a/doc/html/fusion/adapted/adapt_assoc_struct_named.html +++ b/doc/html/fusion/adapted/adapt_assoc_struct_named.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED- + Description
@@ -38,7 +38,7 @@ Sequence. The given struct is adapted using the given name.
- + Synopsis
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( @@ -58,7 +58,7 @@ )- + Semantics
@@ -83,14 +83,14 @@ should be the fully namespace qualified name of the struct to be converted.
- + Header
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp> #include <boost/fusion/include/adapt_assoc_struct_named.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html b/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html index 29fc1ed5..296ee714 100644 --- a/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html +++ b/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT- + Description
@@ -38,7 +38,7 @@ Sequence.
- + Synopsis
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( @@ -50,7 +50,7 @@ )- + Semantics
@@ -72,14 +72,14 @@ should be the fully namespace qualified name of the struct to be adapted.
- + Header
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp> #include <boost/fusion/include/adapt_assoc_struct.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/adapt_struct.html b/doc/html/fusion/adapted/adapt_struct.html index 548a3e22..a1d4e37f 100644 --- a/doc/html/fusion/adapted/adapt_struct.html +++ b/doc/html/fusion/adapted/adapt_struct.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_STRUCT- + Description
@@ -36,7 +36,7 @@ Access Sequence.
- + Synopsis
BOOST_FUSION_ADAPT_STRUCT( @@ -47,7 +47,7 @@ )- + Semantics
@@ -63,14 +63,14 @@ should be the fully namespace qualified name of the struct to be adapted.
- + Header
#include <boost/fusion/adapted/struct/adapt_struct.hpp> #include <boost/fusion/include/adapt_struct.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/adapt_struct_named.html b/doc/html/fusion/adapted/adapt_struct_named.html index 87e9657b..9f96e242 100644 --- a/doc/html/fusion/adapted/adapt_struct_named.html +++ b/doc/html/fusion/adapted/adapt_struct_named.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_STRUCT_NAMED - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_STRUCT_NAMED- + Description
@@ -37,7 +37,7 @@ Access Sequence. The given struct is adapted using the given name.
- + Synopsis
BOOST_FUSION_ADAPT_STRUCT_NAMED( @@ -57,7 +57,7 @@ )- + Semantics
@@ -81,14 +81,14 @@ should be the fully namespace qualified name of the struct to be converted.
- + Header
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp> #include <boost/fusion/include/adapt_struct_named.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/adapt_tpl_struct.html b/doc/html/fusion/adapted/adapt_tpl_struct.html index 0445e863..01c916c3 100644 --- a/doc/html/fusion/adapted/adapt_tpl_struct.html +++ b/doc/html/fusion/adapted/adapt_tpl_struct.html @@ -3,7 +3,7 @@BOOST_FUSION_ADAPT_TPL_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_TPL_STRUCT- + Description
@@ -37,7 +37,7 @@ Sequence.
- + Synopsis
BOOST_FUSION_ADAPT_TPL_STRUCT( @@ -49,7 +49,7 @@ )- + Semantics
@@ -69,14 +69,14 @@ should be the fully namespace qualified name of the struct to be adapted.
- + Header
#include <boost/fusion/adapted/struct/adapt_struct.hpp> #include <boost/fusion/include/adapt_struct.hpp>- + Example
namespace demo diff --git a/doc/html/fusion/adapted/array.html b/doc/html/fusion/adapted/array.html index c9d2398c..d95c88d5 100644 --- a/doc/html/fusion/adapted/array.html +++ b/doc/html/fusion/adapted/array.html @@ -3,7 +3,7 @@Array - + @@ -32,14 +32,14 @@ Access Sequence.- + Header
#include <boost/fusion/adapted/array.hpp> #include <boost/fusion/include/array.hpp>- + Model of
- @@ -47,7 +47,7 @@ Access Sequence
- + Example
int arr[3] = {1,2,3}; diff --git a/doc/html/fusion/adapted/boost__array.html b/doc/html/fusion/adapted/boost__array.html index abb4ee35..0d1ab2ce 100644 --- a/doc/html/fusion/adapted/boost__array.html +++ b/doc/html/fusion/adapted/boost__array.html @@ -3,7 +3,7 @@boost::array - + @@ -33,14 +33,14 @@ Access Sequence.- + Header
#include <boost/fusion/adapted/boost_array.hpp> #include <boost/fusion/include/boost_array.hpp>- + Model of
- @@ -48,7 +48,7 @@ Access Sequence
- + Example
boost::array<int,3> arr = {{1,2,3}}; @@ -60,7 +60,7 @@ std::cout <<at_c
<2>(arr) << std::endl;- + See also
diff --git a/doc/html/fusion/adapted/boost__tuple.html b/doc/html/fusion/adapted/boost__tuple.html index 73d831a0..f28859e2 100644 --- a/doc/html/fusion/adapted/boost__tuple.html +++ b/doc/html/fusion/adapted/boost__tuple.html @@ -3,7 +3,7 @@
boost::tuple - + @@ -33,21 +33,21 @@ Sequence.- + Header
#include <boost/fusion/adapted/boost_tuple.hpp> #include <boost/fusion/include/boost_tuple.hpp>- + Model of
- + Example
boost::tuple<int,std::string> example_tuple(101, "hello"); @@ -55,7 +55,7 @@ std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n';- + See also
diff --git a/doc/html/fusion/adapted/define_assoc_struct.html b/doc/html/fusion/adapted/define_assoc_struct.html index 3392c663..caf565a4 100644 --- a/doc/html/fusion/adapted/define_assoc_struct.html +++ b/doc/html/fusion/adapted/define_assoc_struct.html @@ -3,7 +3,7 @@
BOOST_FUSION_DEFINE_ASSOC_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_DEFINE_ASSOC_STRUCT- + Description
@@ -38,7 +38,7 @@ Sequence.
- + Synopsis
BOOST_FUSION_DEFINE_ASSOC_STRUCT( @@ -68,7 +68,7 @@- + Expression Semantics
@@ -182,14 +182,14 @@- + Header
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp> #include <boost/fusion/include/define_assoc_struct.hpp>- + Example
namespace keys diff --git a/doc/html/fusion/adapted/define_assoc_tpl_struct.html b/doc/html/fusion/adapted/define_assoc_tpl_struct.html index e29a4565..3e56a19d 100644 --- a/doc/html/fusion/adapted/define_assoc_tpl_struct.html +++ b/doc/html/fusion/adapted/define_assoc_tpl_struct.html @@ -3,7 +3,7 @@BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT- + Description
@@ -38,7 +38,7 @@ Sequence.
- + Synopsis
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( @@ -73,7 +73,7 @@- + Expression Semantics
@@ -187,14 +187,14 @@- + Header
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp> #include <boost/fusion/include/define_assoc_struct.hpp>- + Example
namespace keys diff --git a/doc/html/fusion/adapted/define_struct.html b/doc/html/fusion/adapted/define_struct.html index bb7c38d3..bd327f58 100644 --- a/doc/html/fusion/adapted/define_struct.html +++ b/doc/html/fusion/adapted/define_struct.html @@ -3,7 +3,7 @@BOOST_FUSION_DEFINE_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_DEFINE_STRUCT- + Description
@@ -37,7 +37,7 @@ Access Sequence.
- + Synopsis
BOOST_FUSION_DEFINE_STRUCT( @@ -67,7 +67,7 @@- + Expression Semantics
@@ -178,14 +178,14 @@- + Header
#include <boost/fusion/adapted/struct/define_struct.hpp> #include <boost/fusion/include/define_struct.hpp>- + Example
// demo::employee is a Fusion sequence diff --git a/doc/html/fusion/adapted/define_tpl_struct.html b/doc/html/fusion/adapted/define_tpl_struct.html index 901bf2ed..3388fb5c 100644 --- a/doc/html/fusion/adapted/define_tpl_struct.html +++ b/doc/html/fusion/adapted/define_tpl_struct.html @@ -3,7 +3,7 @@
BOOST_FUSION_DEFINE_TPL_STRUCT - + @@ -27,7 +27,7 @@ BOOST_FUSION_DEFINE_TPL_STRUCT- + Description
@@ -37,7 +37,7 @@ Access Sequence.
- + Synopsis
BOOST_FUSION_DEFINE_TPL_STRUCT( @@ -72,7 +72,7 @@- + Expression Semantics
@@ -183,14 +183,14 @@- + Header
#include <boost/fusion/adapted/struct/define_struct.hpp> #include <boost/fusion/include/define_struct.hpp>- + Example
// Any instantiated demo::employee is a Fusion sequence diff --git a/doc/html/fusion/adapted/mpl_sequence.html b/doc/html/fusion/adapted/mpl_sequence.html index 71ec9147..d6e200f4 100644 --- a/doc/html/fusion/adapted/mpl_sequence.html +++ b/doc/html/fusion/adapted/mpl_sequence.html @@ -3,7 +3,7 @@
mpl sequence - + @@ -32,14 +32,14 @@ sequences fully conforming fusion sequences.- + Header
#include <boost/fusion/adapted/mpl.hpp> #include <boost/fusion/include/mpl.hpp>- + Model of
@@ -60,7 +60,7 @@
- + Example
mpl::vector_c<int, 123, 456> vec_c; @@ -73,7 +73,7 @@ std::cout <<at_c
<1>(v) << std::endl;- + See also
diff --git a/doc/html/fusion/adapted/std__pair.html b/doc/html/fusion/adapted/std__pair.html index d3de04da..36548e6e 100644 --- a/doc/html/fusion/adapted/std__pair.html +++ b/doc/html/fusion/adapted/std__pair.html @@ -3,7 +3,7 @@
std::pair - + @@ -33,14 +33,14 @@ Access Sequence.- + Header
#include <boost/fusion/adapted/std_pair.hpp> #include <boost/fusion/include/std_pair.hpp>- + Model of
- @@ -48,7 +48,7 @@ Access Sequence
- + Example
std::pair<int, std::string> p(123, "Hola!!!"); @@ -57,7 +57,7 @@ std::cout << p << std::endl;- + See also
diff --git a/doc/html/fusion/algorithm.html b/doc/html/fusion/algorithm.html index c3e014d5..f338790f 100644 --- a/doc/html/fusion/algorithm.html +++ b/doc/html/fusion/algorithm.html @@ -3,7 +3,7 @@
Algorithm - + @@ -44,7 +44,7 @@- + Lazy Evaluation
@@ -67,7 +67,7 @@ as we want without incurring a high runtime penalty.
- + Sequence Extension
@@ -82,15 +82,12 @@ 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 likepush_back
does not retain the properties - of the original sequence such as associativity ofset
(s). To regain the original sequence, - Conversion functions - are provided. You may use one of the Conversion + sequences are cheaply extensible. 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
#include <boost/fusion/algorithm.hpp> diff --git a/doc/html/fusion/algorithm/iteration.html b/doc/html/fusion/algorithm/iteration.html index 1932c161..03c5901e 100644 --- a/doc/html/fusion/algorithm/iteration.html +++ b/doc/html/fusion/algorithm/iteration.html @@ -3,7 +3,7 @@Iteration - + @@ -35,7 +35,7 @@ a sequence repeatedly applying an operation to its elements.- + Header
#include <boost/fusion/algorithm/iteration.hpp> diff --git a/doc/html/fusion/algorithm/iteration/functions.html b/doc/html/fusion/algorithm/iteration/functions.html index 73525bb1..efda40f5 100644 --- a/doc/html/fusion/algorithm/iteration/functions.html +++ b/doc/html/fusion/algorithm/iteration/functions.html @@ -3,7 +3,7 @@Functions - + @@ -28,6 +28,9 @@ diff --git a/doc/html/fusion/algorithm/iteration/functions/accumulate.html b/doc/html/fusion/algorithm/iteration/functions/accumulate.html index 16ee946a..4bffdb23 100644 --- a/doc/html/fusion/algorithm/iteration/functions/accumulate.html +++ b/doc/html/fusion/algorithm/iteration/functions/accumulate.html @@ -3,10 +3,10 @@accumulate - + - + @@ -20,40 +20,61 @@
-- - Description -
- For a sequence
-seq
, initial - stateinitial_state
, - and binary function object or function pointerf
, - accumulate returns the result of the repeated application of binary -f
to the result of the - previousf
invocation - (inital_state
if it is - the first call) and each element ofseq
. -- - Synopsis -
+ + ++ + Description +
++
++ For a sequence
+ +seq
, + initial stateinitial_state
, + and binary function object or function pointerf
, +accumulate
returns the result of the repeated application + of binaryf
to the + result of the previousf
+ invocation (inital_state
+ if it is the first call) and each element ofseq
. ++ + Synopsis +
++ +
template< typename Sequence, typename State, typename F > -typename+result_of::accumulate
<Sequence, State, F>::type accumulate( - Sequence& seq, State const& initial_state, F const& f); +typenameresult_of::accumulate
<Sequence, State const, F>::type accumulate( + Sequence& seq, State const& initial_state, F f); + +template< + typename Sequence, + typename State, + typename F + > +typenameresult_of::accumulate
<Sequence const, State const, F>::type accumulate( + Sequence const& seq, State const& initial_state, F f);+
--Table 1.38. Parameters
+Table 1.41. Parameters
@@ -62,117 +83,142 @@ - +- Parameter -
-+ Parameter +
+- +- Requirement -
-+ Requirement +
+- +- Description -
-+ Description +
+- +-
-seq
-+
+seq
+- +- A model of Forward - Sequence,
-f(s,e)
must be a valid expression - for current states
, - and each elemente
- inseq
-+ A model of Forward + Sequence +
+- +- Operation's argument -
-+ Operation's argument +
+- +-
-initial_state
-+
+initial_state
+- +- Any type -
-+ Any type +
+- +- Initial state -
-+ Initial state +
+- +-
-f
-+
+f
+- +-
-- is the return type of
boost::result_of
<F(S,E)>::typef(s,e)
current states
of typeS
, - and for each elemente
- of typeE
in -seq
-+
+f(s,e)
with return typemust be a valid expression + for current state
boost::result_of
<F(S,E)>::types
+ of typeS
, + and for each elemente
+ of typeE
+ inseq
+- +- Operation's argument -
-+ Operation's argument +
+- - Expression - Semantics -
-accumulate(seq, initial_state, f); + ++ + Expression + Semantics +
++ +
+accumulate(seq, initial_state, f);- Return type: Any type -
+- Semantics: Equivalent to
-f(... f(f(initial_state,e1),e2) ...eN)
wheree1 - ...eN
- are the elements ofseq
. -- - Complexity -
+ Return type: Any type +- Linear, exactly
-applications of
result_of::size
<Sequence>::valuef
. -- - Header -
-#include <boost/fusion/algorithm/iteration/accumulate.hpp> -#include <boost/fusion/include/accumulate.hpp> + ++ Semantics: Equivalent to
+ +f(... + f(f(initial_state,e1),e2) ...eN)
wheree1 ...eN
+ are the consecutive elements ofseq
. ++ + Complexity +
++
++ Linear, exactly
+ +applications of
result_of::size
<Sequence>::valuef
. ++ + Header +
++ +
+#include <boost/fusion/algorithm/iteration/accumulate.hpp> +#include <boost/fusion/include/accumulate.hpp>-- - Example -
+ ++ + Example +
++ +
struct make_string { typedef std::string result_type; @@ -180,13 +226,15 @@ template<typename T> std::string operator()(const std::string& str, const T& t) const { - return str + boost::lexical_cast<std::string>(t); + return str + boost::lexical_cast<std::string>(t); } }; ... const+vector
<int,int> vec(1,2); -assert(accumulate
(vec,std::string(""), make_string()) == "12"); +assert(accumulate(vec,std::string(""), make_string()) == "12");+
@@ -199,7 +247,7 @@