source:
downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/VariadicSequence.rst
@
29
Last change on this file since 29 was 29, checked in by landauf, 17 years ago | |
---|---|
File size: 3.4 KB |
Variadic Sequence
Description
A |Variadic Sequence| is a member of a family of sequence classes with both variadic and numbered forms. If seq is a generic name for some |Variadic Sequence|, its variadic form allows us to specify a sequence of n elements |t1...tn|, for any n from 0 up to a `preprocessor-configurable limit`__ BOOST_MPL_LIMIT_seq_SIZE, using the following notation:
seq<|t1...tn|>
By contrast, each numbered sequence form accepts the exact number of elements that is encoded in the name of the corresponding class template:
seqn<|t1...tn|>
For numbered forms, there is no predefined top limit for n, aside from compiler limitations on the number of template parameters.
Expression requirements
|In the following table...| seq is a placeholder token for the actual |Variadic Sequence| name.
Expression | Type | Complexity |
---|---|---|
seq<|t1...tn|> | |Forward Sequence| | Amortized constant time |
seq<|t1...tn|>::type | |Forward Sequence| | Amortized constant time |
seqn<|t1...tn|> | |Forward Sequence| | Amortized constant time |
seqn<|t1...tn|>::type | |Forward Sequence| | Amortized constant time |
Expression semantics
typedef seq<|t1...tn|> s; typedef seqn<|t1...tn|> s;
Semantics: | s is a sequence of elements |t1...tn|. |
---|---|
Postcondition: | size<s>::value == n. |
typedef seq<|t1...tn|>::type s; typedef seqn<|t1...tn|>::type s;
Semantics: | s is identical to seqn<|t1...tn| >. |
---|---|
Postcondition: | size<s>::value == n. |
See also
|Sequences|, |Configuration|, |Integral Sequence Wrapper|
<reference anonymous="1" name="variadic"> variadic
.. |variadic| replace:: `variadic`__
<reference anonymous="1" name="variadic forms"> variadic forms
.. |variadic forms| replace:: `variadic forms`__
<reference anonymous="1" name="numbered forms"> numbered forms
.. |numbered forms| replace:: `numbered forms`__