Merge pull request #53 from Flast/bugfix/documentation

Documentation bugfix.
This commit is contained in:
Joel de Guzman
2015-02-09 06:35:12 +08:00
6 changed files with 68 additions and 62 deletions

View File

@@ -441,10 +441,10 @@ Linear, exactly `__result_of_size__<Sequence>::value` applications of `F`.
[endsect] [endsect]
[section for_each] [section for_each]
A metafunction returning the result type of applying __for_each__ to a sequence. The
return type of __for_each__ is always `void`.
[heading Description] [heading Description]
A metafunction returning the result type of applying __for_each__ to a sequence. The
return type of __for_each__ is always `void`.
[heading Synopsis] [heading Synopsis]
template< template<
@@ -724,6 +724,8 @@ or `__end__(seq)` if there is no such element.
[heading Complexity] [heading Complexity]
Linear. At most `__result_of_size__<Sequence>::value` comparisons. Linear. At most `__result_of_size__<Sequence>::value` comparisons.
[heading Header]
#include <boost/fusion/algorithm/query/find_if.hpp> #include <boost/fusion/algorithm/query/find_if.hpp>
#include <boost/fusion/include/find_if.hpp> #include <boost/fusion/include/find_if.hpp>
@@ -1361,7 +1363,7 @@ Returns a new sequence, with all the elements of the original sequence, except t
typename T, typename T,
typename Sequence typename Sequence
> >
typename __result_of_remove__<Sequence const, T>::type replace(Sequence const& seq); typename __result_of_remove__<Sequence const, T>::type remove(Sequence const& seq);
[table Parameters [table Parameters
[[Parameter][Requirement][Description]] [[Parameter][Requirement][Description]]
@@ -1830,7 +1832,7 @@ Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/include/pop_back.hpp> #include <boost/fusion/include/pop_back.hpp>
[heading Example] [heading Example]
assert(___pop_back__(__make_vector__(1,2,3)) == __make_vector__(1,2)); assert(__pop_back__(__make_vector__(1,2,3)) == __make_vector__(1,2));
[endsect] [endsect]
@@ -2089,32 +2091,33 @@ Constant.
[section transform] [section transform]
[heading Description] [heading Description]
For a sequence `seq` and function object or function pointer `f`, `transform` returns a new sequence Returns the result type of __transform__, given the types of the input sequence and unary __poly_func_obj__.
with elements created by applying `f(e)` to each element of `e` of `seq`.
[heading Unary version synopsis] [heading Unary version synopsis]
template< template<
typename Sequence, typename Sequence,
typename F typename F
> >
typename __result_of_transform__<Sequence const, F>::type transform( struct transform
Sequence const& seq, F f); {
typedef __unspecified__ type;
};
[table Parameters [table Parameters
[[Parameter][Requirement][Description]] [[Parameter][Requirement][Description]]
[[`seq`][A model of __forward_sequence__][Operation's argument]] [[`Sequence`][A model of __forward_sequence__][Operation's argument]]
[[`f`][`f(e)` is a valid expression for each element `e` of `seq`. `__boost_result_of_call__<F(E)>::type` is the return type of `f` when called with a value of each element type `E`.][Transformation function]] [[`F`][A model of unary __poly_func_obj__][Transformation metafunction]]
] ]
[heading Expression Semantics] [heading Expression Semantics]
__transform__(seq, f); __result_of_transform__<Sequence, F>::type
[*Return type]: [*Return type]:
* A model of __forward_sequence__ * A model of __forward_sequence__
* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. * A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing the return values of `f(e)` for each element `e` within `seq`. [*Semantics]: Returns a sequence that contains the types of `__result_of__<F(E)>::type` for each element `E` within `Sequence`.
[heading Binary version synopsis] [heading Binary version synopsis]
template< template<
@@ -2122,41 +2125,33 @@ with elements created by applying `f(e)` to each element of `e` of `seq`.
typename Sequence2, typename Sequence2,
typename F typename F
> >
typename __result_of_transform__<Sequence1 const, Sequence2 const, F>::type transform( struct transform
Sequence1 const& seq1, Sequence2 const& seq2, F f); {
typedef __unspecified__ type;
};
[table Parameters [table Parameters
[[Parameter][Requirement][Description]] [[Parameter][Requirement][Description]]
[[`seq1`][A model of __forward_sequence__][Operation's argument]] [[`Sequence1`][A model of __forward_sequence__][Operation's argument]]
[[`seq2`][A model of __forward_sequence__][Operation's argument]] [[`Sequence2`][A model of __forward_sequence__][Operation's argument]]
[[`f`][`f(e1,e2)` is a valid expression for each pair of elements `e1` of `seq1` and `e2` of `seq2`. `__boost_result_of_call__<F(E1,E2)>::type` is the return type of `f` when called with elements of type `E1` and `E2`][Transformation function]] [[`F`][A model of binary __poly_func_obj__][Transformation metafunction]]
] ]
[heading Expression Semantics]
__result_of_transform__<Sequence1, Sequence2, F>::type
[*Return type]: A model of __forward_sequence__. [*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 sequence, that contains the types of `__result_of__<F(E1, E2)>::type` for each pair of elements `E1` and `E2` within `Sequence1` and `Sequence2` respectively.
[heading Complexity] [heading Complexity]
Constant. Returns a view which is lazily evaluated. Constant.
[heading Header] [heading Header]
#include <boost/fusion/algorithm/transformation/transform.hpp> #include <boost/fusion/algorithm/transformation/transform.hpp>
#include <boost/fusion/include/transform.hpp> #include <boost/fusion/include/transform.hpp>
[heading Example]
struct triple
{
typedef int result_type;
int operator()(int t) const
{
return t * 3;
};
};
...
assert(__transform__(__make_vector__(1,2,3), triple()) == __make_vector__(3,6,9));
[endsect] [endsect]
[section replace] [section replace]
@@ -2200,7 +2195,7 @@ Constant.
[section replace_if] [section replace_if]
[heading Description] [heading Description]
Returns the result type of __replace_if__, given the types of the sequence, __poly_func_obj__ predicate and replacement object. Returns the result type of __replace_if__, given the types of the sequence, unary __mpl_lambda_expression__ predicate and replacement object.
[heading Synopsis] [heading Synopsis]
template< template<
@@ -2215,7 +2210,7 @@ Returns the result type of __replace_if__, given the types of the sequence, __po
[table Parameters [table Parameters
[[Parameter][Requirement][Description]] [[Parameter][Requirement][Description]]
[[`Sequence`][A model of __forward_sequence__][Operation's argument]] [[`Sequence`][A model of __forward_sequence__][Operation's argument]]
[[`F`][A model of unary __poly_func_obj__][Replacement predicate]] [[`F`][A model of unary __mpl_lambda_expression__][Replacement predicate]]
[[`T`][Any type][The type of the replacement object]] [[`T`][Any type][The type of the replacement object]]
] ]
@@ -2265,7 +2260,7 @@ Returns the result type of __remove__, given the sequence and removal types.
* A model of __forward_sequence__. * A model of __forward_sequence__.
* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. * A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `Sequence` not of type `T`. Equivalent to `__result_of_replace_if__<Sequence, boost::is_same<mpl::_, T> >::type`. [*Semantics]: Returns a sequence containing the elements of `Sequence` not of type `T`. Equivalent to `__result_of_remove_if__<Sequence, boost::is_same<mpl::_, T> >::type`.
[heading Complexity] [heading Complexity]
Constant. Constant.

View File

@@ -323,7 +323,7 @@ For our __random_access_sequence__ we will also need to implement `size_impl`,
In order for `example_struct` to serve as an associative forward sequence, In order for `example_struct` to serve as an associative forward sequence,
we need to adapt the traversal category of our sequence and our iterator we need to adapt the traversal category of our sequence and our iterator
accordingly and enable 3 intrinsic sequence lookup features, __at_key__, accordingly and enable 3 intrinsic sequence lookup features, __at_key__,
__value_at_key__ and __has_key__. We also need to enable 3 iterator lookup __result_of_value_at_key__ and __has_key__. We also need to enable 3 iterator lookup
features, __result_of_key_of__, __result_of_value_of_data__ and __deref_data__. features, __result_of_key_of__, __result_of_value_of_data__ and __deref_data__.
To implement `at_key_impl` we need to associate the `fields::name` and `fields::age` To implement `at_key_impl` we need to associate the `fields::name` and `fields::age`

View File

@@ -321,10 +321,10 @@
[def __result_of_invoke__ [link fusion.functional.invocation.metafunctions.invoke `result_of::invoke`]] [def __result_of_invoke__ [link fusion.functional.invocation.metafunctions.invoke `result_of::invoke`]]
[def __result_of_invoke_procedure__ [link fusion.functional.invocation.metafunctions.invoke_proc `result_of::invoke_procedure`]] [def __result_of_invoke_procedure__ [link fusion.functional.invocation.metafunctions.invoke_proc `result_of::invoke_procedure`]]
[def __result_of_invoke_function_object__ [link fusion.functional.invocation.metafunctions.invoke_fobj `result_of::invoke_function_object`]] [def __result_of_invoke_function_object__ [link fusion.functional.invocation.metafunctions.invoke_fobj `result_of::invoke_function_object`]]
[def __result_of_make_fused__ [link fusion.functional.generation.metafunctions.mk_fused `make_fused`]] [def __result_of_make_fused__ [link fusion.functional.generation.metafunctions.mk_fused `result_of::make_fused`]]
[def __result_of_make_fused_procedure__ [link fusion.functional.generation.metafunctions.mk_fused_proc `make_fused_procedure`]] [def __result_of_make_fused_procedure__ [link fusion.functional.generation.metafunctions.mk_fused_proc `result_of::make_fused_procedure`]]
[def __result_of_make_fused_function_object__ [link fusion.functional.generation.metafunctions.mk_fused_fobj `make_fused_function_object`]] [def __result_of_make_fused_function_object__ [link fusion.functional.generation.metafunctions.mk_fused_fobj `result_of::make_fused_function_object`]]
[def __result_of_make_unfused__ [link fusion.functional.generation.metafunctions.mk_unfused `make_unfused`]] [def __result_of_make_unfused__ [link fusion.functional.generation.metafunctions.mk_unfused `result_of::make_unfused`]]
[def __recursive_inline__ [link fusion.notes.recursive_inlined_functions Recursive Inlined Functions]] [def __recursive_inline__ [link fusion.notes.recursive_inlined_functions Recursive Inlined Functions]]
[def __overloaded_functions__ [link fusion.notes.overloaded_functions Overloaded Functions]] [def __overloaded_functions__ [link fusion.notes.overloaded_functions Overloaded Functions]]

View File

@@ -67,8 +67,7 @@ the following expressions are valid:
] ]
[heading Expression Semantics] [heading Expression Semantics]
[ [table
table
[[Expression] [Semantics]] [[Expression] [Semantics]]
[[`__next__(i)`] [An iterator to the element following `i`]] [[`__next__(i)`] [An iterator to the element following `i`]]
[[`i == j`] [Iterator equality comparison]] [[`i == j`] [Iterator equality comparison]]
@@ -418,15 +417,15 @@ Moves an iterator by a specified distance.
[heading Synopsis] [heading Synopsis]
template< template<
typename I, typename M,
typename M typename I
> >
typename __result_of_advance__<I, M>::type advance(I const& i); typename __result_of_advance__<I, M>::type advance(I const& i);
[table Parameters [table Parameters
[[Parameter] [Requirement] [Description]] [[Parameter] [Requirement] [Description]]
[[`i`] [Model of __forward_iterator__] [Iterator to move relative to]] [[`i`] [Model of __forward_iterator__] [Iterator to move relative to]]
[[`N`] [An __mpl_integral_constant__] [Number of positions to move]] [[`M`] [An __mpl_integral_constant__] [Number of positions to move]]
] ]
[heading Expression Semantics] [heading Expression Semantics]
@@ -455,8 +454,8 @@ Moves an iterator by a specified distance.
[heading Synopsis] [heading Synopsis]
template< template<
typename I, int N,
int N typename I
> >
typename __result_of_advance_c__<I, N>::type advance_c(I const& i); typename __result_of_advance_c__<I, N>::type advance_c(I const& i);
@@ -537,7 +536,7 @@ Dereferences an iterator.
template< template<
typename I typename I
> >
typename __result_of_deref__<I>::type operator*(__unspecified__<I> const& i); typename __result_of_deref__<I>::type operator*(I const& i);
[table Parameters [table Parameters
[[Parameter] [Requirement] [Description]] [[Parameter] [Requirement] [Description]]

View File

@@ -36,20 +36,26 @@ link against.
* tuple * tuple
* algorithm * algorithm
* auxiliary
* iteration * iteration
* query * query
* transformation * transformation
* adapted * adapted
* adt
* array * array
* mpl * boost::array
* boost::tuple * boost::tuple
* mpl
* std_pair * std_pair
* std_tuple
* struct * struct
* variant
* view * view
* filter_view * filter_view
* flatten_view
* iterator_range * iterator_range
* joint_view * joint_view
* nview
* repetitive_view
* reverse_view * reverse_view
* single_view * single_view
* transform_view * transform_view
@@ -63,6 +69,9 @@ link against.
* generation * generation
* mpl * mpl
* functional * functional
* adapter
* generation
* invocation
* sequence * sequence
* comparison * comparison
* intrinsic * intrinsic

View File

@@ -249,15 +249,18 @@ any Random Access Sequence the following must be met:
[[Expression] [Compile Time Complexity]] [[Expression] [Compile Time Complexity]]
[[`__result_of_begin__<S>::type`] [Amortized constant time]] [[`__result_of_begin__<S>::type`] [Amortized constant time]]
[[`__result_of_end__<S>::type`] [Amortized constant time]] [[`__result_of_end__<S>::type`] [Amortized constant time]]
[[`__result_of_at__<S, N>::type`] [Amortized constant time]] [[`__result_of_at__<S, M>::type`] [Amortized constant time]]
[[`__result_of_value_at__<S, N>::type`] [Amortized constant time]] [[`__result_of_at_c__<S, N>::type`] [Amortized constant time]]
[[`__result_of_value_at__<S, M>::type`] [Amortized constant time]]
[[`__result_of_value_at_c__<S, N>::type`] [Amortized constant time]]
] ]
[blurb __note__ `__result_of_at__<S, N>` returns the actual type returned by [blurb __note__ `__result_of_at__<S, M>` returns the actual type returned by
`__at__<N>(s)`. In most cases, this is a reference. Hence, there is no way to `__at__<M>(s)`. 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` know the exact element type using `__result_of_at__<S, M>`.The element at `M`
may actually be a reference to begin with. For this purpose, you can use 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, M>` (Note that, `__result_of_value_at_c__<S, N>`
is a counterpart of `__result_of_at_c__<S, N>` as well).]
[heading Expression Semantics] [heading Expression Semantics]
@@ -331,7 +334,7 @@ For any Associative Sequence the following expressions must be valid:
by `__at_key__<K>(s)`. In most cases, this is a reference. Hence, there is no by `__at_key__<K>(s)`. 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 way to know the exact element type using `__result_of_at_key__<S, K>`.The
element at `K` may actually be a reference to begin with. For this purpose, element at `K` may actually be a reference to begin with. For this purpose,
you can use `__result_of_value_at_key__<S, N>`.] you can use `__result_of_value_at_key__<S, K>`.]
[heading Expression Semantics] [heading Expression Semantics]
@@ -1323,7 +1326,7 @@ Returns the result type of __has_key__.
[heading Description] [heading Description]
Returns the result type of __at_key__[footnote __result_of_at_key__ Returns the result type of __at_key__[footnote __result_of_at_key__
reflects the actual return type of the function __at_key__. __sequence__s reflects the actual return type of the function __at_key__. __sequence__(s)
typically return references to its elements via the __at_key__ function. If 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__]. you want to get the actual element type, use __result_of_value_at_key__].
@@ -1445,7 +1448,7 @@ operators for free.
The I/O operators: `<<` and `>>` work generically on all Fusion The I/O operators: `<<` and `>>` work generically on all Fusion
sequences. The I/O operators are overloaded in namespace `boost::fusion` sequences. The I/O operators are overloaded in namespace `boost::fusion`
[footnote __sequences__ and __views__ residing in different namespaces [footnote __sequence__(s) and __views__ residing in different namespaces
will have to either provide their own I/O operators (possibly forwarding will have to either provide their own I/O operators (possibly forwarding
to fusion's I/O operators) or hoist fusion's I/O operators (using to fusion's I/O operators) or hoist fusion's I/O operators (using
declaration), in their own namespaces for proper argument dependent declaration), in their own namespaces for proper argument dependent
@@ -1637,7 +1640,7 @@ compile time error.
[*Semantics]: [*Semantics]:
For each element, `e1`, in sequence `a`, and for each element, `e2`, in 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, sequence `b`, `e1 == e2` returns true. For any 2 zero length __sequence__(s),
e and f, e == f returns true. e and f, e == f returns true.
[heading Header] [heading Header]