diff --git a/doc/algorithm.qbk b/doc/algorithm.qbk index d902ebe4..f47fce5c 100644 --- a/doc/algorithm.qbk +++ b/doc/algorithm.qbk @@ -441,10 +441,10 @@ Linear, exactly `__result_of_size__::value` applications of `F`. [endsect] [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] +A metafunction returning the result type of applying __for_each__ to a sequence. The +return type of __for_each__ is always `void`. [heading Synopsis] template< @@ -724,8 +724,10 @@ or `__end__(seq)` if there is no such element. [heading Complexity] Linear. At most `__result_of_size__::value` comparisons. -#include -#include +[heading Header] + + #include + #include [heading Example] const __vector__ vec(1.0,2); @@ -1361,7 +1363,7 @@ Returns a new sequence, with all the elements of the original sequence, except t typename T, typename Sequence > - typename __result_of_remove__::type replace(Sequence const& seq); + typename __result_of_remove__::type remove(Sequence const& seq); [table Parameters [[Parameter][Requirement][Description]] @@ -1830,7 +1832,7 @@ Constant. Returns a view which is lazily evaluated. #include [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] @@ -2089,32 +2091,33 @@ Constant. [section transform] [heading Description] -For a sequence `seq` and function object or function pointer `f`, `transform` returns a new sequence -with elements created by applying `f(e)` to each element of `e` of `seq`. +Returns the result type of __transform__, given the types of the input sequence and unary __poly_func_obj__. [heading Unary version synopsis] template< typename Sequence, typename F > - typename __result_of_transform__::type transform( - Sequence const& seq, F f); + struct transform + { + typedef __unspecified__ type; + }; [table Parameters [[Parameter][Requirement][Description]] - [[`seq`][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__::type` is the return type of `f` when called with a value of each element type `E`.][Transformation function]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`F`][A model of unary __poly_func_obj__][Transformation metafunction]] ] [heading Expression Semantics] - __transform__(seq, f); + __result_of_transform__::type [*Return type]: * A model of __forward_sequence__ * 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__::type` for each element `E` within `Sequence`. [heading Binary version synopsis] template< @@ -2122,41 +2125,33 @@ with elements created by applying `f(e)` to each element of `e` of `seq`. typename Sequence2, typename F > - typename __result_of_transform__::type transform( - Sequence1 const& seq1, Sequence2 const& seq2, F f); + struct transform + { + typedef __unspecified__ type; + }; [table Parameters [[Parameter][Requirement][Description]] - [[`seq1`][A model of __forward_sequence__][Operation's argument]] - [[`seq2`][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__::type` is the return type of `f` when called with elements of type `E1` and `E2`][Transformation function]] + [[`Sequence1`][A model of __forward_sequence__][Operation's argument]] + [[`Sequence2`][A model of __forward_sequence__][Operation's argument]] + [[`F`][A model of binary __poly_func_obj__][Transformation metafunction]] ] +[heading Expression Semantics] + __result_of_transform__::type + [*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__::type` for each pair of elements `E1` and `E2` within `Sequence1` and `Sequence2` respectively. [heading Complexity] -Constant. Returns a view which is lazily evaluated. +Constant. [heading Header] #include #include -[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] [section replace] @@ -2200,7 +2195,7 @@ Constant. [section replace_if] [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] template< @@ -2215,7 +2210,7 @@ Returns the result type of __replace_if__, given the types of the sequence, __po [table Parameters [[Parameter][Requirement][Description]] [[`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]] ] @@ -2265,7 +2260,7 @@ Returns the result type of __remove__, given the sequence and removal types. * A model of __forward_sequence__. * 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__ >::type`. +[*Semantics]: Returns a sequence containing the elements of `Sequence` not of type `T`. Equivalent to `__result_of_remove_if__ >::type`. [heading Complexity] Constant. diff --git a/doc/extension.qbk b/doc/extension.qbk index 96e5ef61..cbb61ce5 100644 --- a/doc/extension.qbk +++ b/doc/extension.qbk @@ -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, we need to adapt the traversal category of our sequence and our iterator 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__. To implement `at_key_impl` we need to associate the `fields::name` and `fields::age` diff --git a/doc/fusion.qbk b/doc/fusion.qbk index f6c5f654..829979e6 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -321,10 +321,10 @@ [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_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_procedure__ [link fusion.functional.generation.metafunctions.mk_fused_proc `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_unfused__ [link fusion.functional.generation.metafunctions.mk_unfused `make_unfused`]] +[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 `result_of::make_fused_procedure`]] +[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 `result_of::make_unfused`]] [def __recursive_inline__ [link fusion.notes.recursive_inlined_functions Recursive Inlined Functions]] [def __overloaded_functions__ [link fusion.notes.overloaded_functions Overloaded Functions]] diff --git a/doc/iterator.qbk b/doc/iterator.qbk index 50430a4d..d400003c 100644 --- a/doc/iterator.qbk +++ b/doc/iterator.qbk @@ -67,8 +67,7 @@ the following expressions are valid: ] [heading Expression Semantics] -[ -table +[table [[Expression] [Semantics]] [[`__next__(i)`] [An iterator to the element following `i`]] [[`i == j`] [Iterator equality comparison]] @@ -418,15 +417,15 @@ Moves an iterator by a specified distance. [heading Synopsis] template< - typename I, - typename M + typename M, + typename I > typename __result_of_advance__::type advance(I const& i); [table Parameters [[Parameter] [Requirement] [Description]] [[`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] @@ -455,8 +454,8 @@ Moves an iterator by a specified distance. [heading Synopsis] template< - typename I, - int N + int N, + typename I > typename __result_of_advance_c__::type advance_c(I const& i); @@ -537,7 +536,7 @@ Dereferences an iterator. template< typename I > - typename __result_of_deref__::type operator*(__unspecified__ const& i); + typename __result_of_deref__::type operator*(I const& i); [table Parameters [[Parameter] [Requirement] [Description]] diff --git a/doc/organization.qbk b/doc/organization.qbk index e3dd7fb4..b7166f5d 100644 --- a/doc/organization.qbk +++ b/doc/organization.qbk @@ -36,20 +36,26 @@ link against. * tuple * algorithm + * auxiliary * iteration * query * transformation * adapted + * adt * array - * mpl + * boost::array * boost::tuple + * mpl * std_pair + * std_tuple * struct - * variant * view * filter_view + * flatten_view * iterator_range * joint_view + * nview + * repetitive_view * reverse_view * single_view * transform_view @@ -63,6 +69,9 @@ link against. * generation * mpl * functional + * adapter + * generation + * invocation * sequence * comparison * intrinsic diff --git a/doc/sequence.qbk b/doc/sequence.qbk index 2d323e37..4722124a 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -249,15 +249,18 @@ any Random Access Sequence the following must be met: [[Expression] [Compile Time Complexity]] [[`__result_of_begin__::type`] [Amortized constant time]] [[`__result_of_end__::type`] [Amortized constant time]] - [[`__result_of_at__::type`] [Amortized constant time]] - [[`__result_of_value_at__::type`] [Amortized constant time]] + [[`__result_of_at__::type`] [Amortized constant time]] + [[`__result_of_at_c__::type`] [Amortized constant time]] + [[`__result_of_value_at__::type`] [Amortized constant time]] + [[`__result_of_value_at_c__::type`] [Amortized constant time]] ] -[blurb __note__ `__result_of_at__` returns the actual type returned by -`__at__(s)`. In most cases, this is a reference. Hence, there is no way to -know the exact element type using `__result_of_at__`.The element at `N` +[blurb __note__ `__result_of_at__` returns the actual type returned by +`__at__(s)`. In most cases, this is a reference. Hence, there is no way to +know the exact element type using `__result_of_at__`.The element at `M` may actually be a reference to begin with. For this purpose, you can use -`__result_of_value_at__`.] +`__result_of_value_at__` (Note that, `__result_of_value_at_c__` +is a counterpart of `__result_of_at_c__` as well).] [heading Expression Semantics] @@ -331,7 +334,7 @@ For any Associative Sequence the following expressions must be valid: by `__at_key__(s)`. In most cases, this is a reference. Hence, there is no way to know the exact element type using `__result_of_at_key__`.The element at `K` may actually be a reference to begin with. For this purpose, -you can use `__result_of_value_at_key__`.] +you can use `__result_of_value_at_key__`.] [heading Expression Semantics] @@ -1323,7 +1326,7 @@ Returns the result type of __has_key__. [heading Description] 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 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 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 to fusion's I/O operators) or hoist fusion's I/O operators (using declaration), in their own namespaces for proper argument dependent @@ -1637,7 +1640,7 @@ compile time error. [*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 __sequence__s, +sequence `b`, `e1 == e2` returns true. For any 2 zero length __sequence__(s), e and f, e == f returns true. [heading Header]