Add documents for No-bounds sequences.

This commit is contained in:
Kohei Takahashi
2015-03-22 09:45:17 +09:00
parent 1e21a4eb7a
commit 8aa35da4c4
5 changed files with 81 additions and 3 deletions

View File

@ -79,6 +79,7 @@
[def __bidirectional_iterator__ [link fusion.iterator.concepts.bidirectional_iterator Bidirectional Iterator]] [def __bidirectional_iterator__ [link fusion.iterator.concepts.bidirectional_iterator Bidirectional Iterator]]
[def __random_access_iterator__ [link fusion.iterator.concepts.random_access_iterator Random Access Iterator]] [def __random_access_iterator__ [link fusion.iterator.concepts.random_access_iterator Random Access Iterator]]
[def __associative_iterator__ [link fusion.iterator.concepts.associative_iterator Associative Iterator]] [def __associative_iterator__ [link fusion.iterator.concepts.associative_iterator Associative Iterator]]
[def __no_bounds_iterator__ [link fusion.iterator.concepts.no_bounds_iterator No-bounds Iterator]]
[def __next__ [link fusion.iterator.functions.next `next`]] [def __next__ [link fusion.iterator.functions.next `next`]]
[def __prior__ [link fusion.iterator.functions.prior `prior`]] [def __prior__ [link fusion.iterator.functions.prior `prior`]]
@ -108,6 +109,7 @@
[def __bidirectional_sequence__ [link fusion.sequence.concepts.bidirectional_sequence Bidirectional Sequence]] [def __bidirectional_sequence__ [link fusion.sequence.concepts.bidirectional_sequence Bidirectional Sequence]]
[def __random_access_sequence__ [link fusion.sequence.concepts.random_access_sequence Random Access Sequence]] [def __random_access_sequence__ [link fusion.sequence.concepts.random_access_sequence Random Access Sequence]]
[def __associative_sequence__ [link fusion.sequence.concepts.associative_sequence Associative Sequence]] [def __associative_sequence__ [link fusion.sequence.concepts.associative_sequence Associative Sequence]]
[def __no_bounds_sequence__ [link fusion.sequence.concepts.no_bounds_sequence No-bounds Sequence]]
[def __containers__ [link fusion.container Container]] [def __containers__ [link fusion.container Container]]
[def __vector__ [link fusion.container.vector `vector`]] [def __vector__ [link fusion.container.vector `vector`]]
@ -337,6 +339,8 @@
[def __adt_attribute_proxy__ [link fusion.notes.adt_attribute_proxy `adt_attribute_proxy`]] [def __adt_attribute_proxy__ [link fusion.notes.adt_attribute_proxy `adt_attribute_proxy`]]
[def __window_function__ [@http://en.wikipedia.org/wiki/Window_function Window Function]]
[include preface.qbk] [include preface.qbk]
[include introduction.qbk] [include introduction.qbk]
[include quick_start.qbk] [include quick_start.qbk]

View File

@ -69,6 +69,8 @@
Access Iterator</a></span></dt> Access Iterator</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/concepts/associative_iterator.html">Associative <dt><span class="section"><a href="fusion/iterator/concepts/associative_iterator.html">Associative
Iterator</a></span></dt> Iterator</a></span></dt>
<dt><span class="section"><a href="fusion/iterator/concepts/no_bounds_iterator.html">No-bounds
Iterator</a></span></dt>
</dl></dd> </dl></dd>
<dt><span class="section"><a href="fusion/iterator/functions.html">Functions</a></span></dt> <dt><span class="section"><a href="fusion/iterator/functions.html">Functions</a></span></dt>
<dd><dl> <dd><dl>
@ -116,6 +118,8 @@
Access Sequence</a></span></dt> Access Sequence</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/concepts/associative_sequence.html">Associative <dt><span class="section"><a href="fusion/sequence/concepts/associative_sequence.html">Associative
Sequence</a></span></dt> Sequence</a></span></dt>
<dt><span class="section"><a href="fusion/sequence/concepts/no_bounds_sequence.html">No-bounds
Sequence</a></span></dt>
</dl></dd> </dl></dd>
<dt><span class="section"><a href="fusion/sequence/intrinsic.html">Intrinsic</a></span></dt> <dt><span class="section"><a href="fusion/sequence/intrinsic.html">Intrinsic</a></span></dt>
<dd><dl> <dd><dl>

View File

@ -257,6 +257,12 @@ expressions must be valid:
[endsect] [endsect]
[section No-bounds Iterator]
[warning In this release, __no_bounds_iterator__ concept has no effect. It's reserved for future release.]
[endsect]
[endsect] [endsect]
[section Functions] [section Functions]

View File

@ -39,6 +39,11 @@ These concepts pertain to sequence traversal.
The __associative_sequence__ concept is orthogonal to traversal. An Associative The __associative_sequence__ concept is orthogonal to traversal. An Associative
Sequence allows efficient retrieval of elements based on keys. Sequence allows efficient retrieval of elements based on keys.
[heading Boundary]
The __no_bounds_sequence__ concept is also orthogonal to traversal and associativity.
A No-bounds Sequence allows out-of-bounds access.
[section Forward Sequence] [section Forward Sequence]
[heading Description] [heading Description]
@ -359,6 +364,55 @@ you can use `__result_of_value_at_key__<S, K>`.]
[endsect] [endsect]
[section No-bounds Sequence]
[heading Description]
A No-bounds Sequence allows Out-of-Bounds access: it will achieve something like a __window_function__.
Most of the sequences do not meet this concept, but some special usecases do.
[important User extending sequences should handle any parameters or be SFINAE-friendly.]
[variablelist Notation
[[`s`] [An Fusion Sequence]]
[[`S`] [An Fusion Sequence type]]
[[`M`] [An __mpl__ integral constant]]
[[`N`] [An integral constant]]
[[`K`] [An arbitrary /key/ type]]
[[`o`] [An arbitrary object]]
[[`e`] [A Sequence element]]
]
[heading Valid Expressions]
[table
[[Expression] [Return type] [Type Requirements] [Runtime Complexity]]
[[`__at_c__<N>(s)`] [Any type] [] [Depends on its traversability]]
[[`__at_c__<N>(s) = o`] [Any type] [] [Depends on its traversability]]
[[`__at__<M>(s)`] [Any type] [] [Depends on its traversability]]
[[`__at__<M>(s) = o`] [Any type] [] [Depends on its traversability]]
[[`__at_key__<K>(s)`] [Any type] [`S` should be __associative_sequence__] [Depends on its traversability]]
[[`__at_key__<K>(s) = o`] [Any type] [`S` should be __associative_sequence__] [Depends on its traversability]]
]
[heading Result Type Expressions]
[table
[[Expression] [Compile Time Complexity]]
[[`__result_of_at__<S, M>::type`] [Depends on its traversability]]
[[`__result_of_at_c__<S, N>::type`] [Depends on its traversability]]
[[`__result_of_value_at__<S, M>::type`] [Depends on its traversability]]
[[`__result_of_value_at_c__<S, N>::type`] [Depends on its traversability]]
[[`__result_of_at_key__<S, K>::type`] [Depends on its traversability]]
[[`__result_of_value_at_key__<S, K>::type`] [Depends on its traversability]]
]
[heading Models]
* none.
[endsect]
[endsect] [endsect]
[section Intrinsic] [section Intrinsic]
@ -686,7 +740,7 @@ element from the beginning of the sequence, is a valid expression. Else,
returns a type convertible to the M-th element from the beginning of the returns a type convertible to the M-th element from the beginning of the
sequence. sequence.
[*Precondition]: `0 <= M::value < __size__(s)` [*Precondition]: `0 <= M::value < __size__(seq)` (where `seq` is not __no_bounds_sequence__)
[*Semantics]: Equivalent to [*Semantics]: Equivalent to
@ -739,7 +793,7 @@ element from the beginning of the sequence, is a valid expression. Else,
returns a type convertible to the N-th element from the beginning of the returns a type convertible to the N-th element from the beginning of the
sequence. sequence.
[*Precondition]: `0 <= N < __size__(s)` [*Precondition]: `0 <= N < __size__(seq)` (where `seq` is not __no_bounds_sequence__)
[*Semantics]: Equivalent to [*Semantics]: Equivalent to
@ -833,7 +887,7 @@ 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 element associated with Key, is a valid expression. Else, returns a type
convertible to the element associated with Key. convertible to the element associated with Key.
[*Precondition]: `has_key<Key>(seq) == true` [*Precondition]: `has_key<Key>(seq) == true` (where `seq` is not __no_bounds_sequence__)
[*Semantics]: Returns the element associated with Key. [*Semantics]: Returns the element associated with Key.
@ -1149,6 +1203,8 @@ the actual element type, use __result_of_value_at__].
[*Return type]: Any type. [*Return type]: Any type.
[*Precondition]: `0 <= M::value < __result_of_size__<Seq>::value` (where `Seq` is not __no_bounds_sequence__)
[*Semantics]: Returns the result type of using __at__ to access the `M`th element of `Seq`. [*Semantics]: Returns the result type of using __at__ to access the `M`th element of `Seq`.
[heading Header] [heading Header]
@ -1191,6 +1247,8 @@ get the actual element type, use __result_of_value_at_c__].
[*Return type]: Any type [*Return type]: Any type
[*Precondition]: `0 <= N < __result_of_size__<Seq>::value` (where `Seq` is not __no_bounds_sequence__)
[*Semantics]: Returns the result type of using __at_c__ to access the `N`th element of `Seq`. [*Semantics]: Returns the result type of using __at_c__ to access the `N`th element of `Seq`.
[heading Header] [heading Header]
@ -1350,6 +1408,8 @@ you want to get the actual element type, use __result_of_value_at_key__].
[*Return type]: Any type. [*Return type]: Any type.
[*Precondition]: `has_key<Seq, Key>::type::value == true` (where `Seq` is not __no_bounds_sequence__)
[*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`.
[heading Header] [heading Header]
@ -1388,6 +1448,8 @@ Returns the actual element type associated with a Key from the __sequence__.
[*Return type]: Any type. [*Return type]: Any type.
[*Precondition]: `has_key<Seq, Key>::type::value == true` (where `Seq` is not __no_bounds_sequence__)
[*Semantics]: Returns the actual element type associated with key type [*Semantics]: Returns the actual element type associated with key type
`Key` in `Seq`. `Key` in `Seq`.

View File

@ -227,6 +227,8 @@ And optionally from:
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
struct associative_tag {}; struct associative_tag {};
struct no_bounds_tag {};
}} }}
[*Semantics]: Establishes the conceptual classification of a particular [*Semantics]: Establishes the conceptual classification of a particular