Back to Arangodb

range_c

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/range-c.html

3.12.9.15.0 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Classes / range_c |

range_c

Synopsis

template<
      typename T
    , T Start
    , T Finish
    >
struct[range\_c](./range-c.html){
    typedef[integral\_c](./integral-c.html)<T,Start> start;
    typedef[integral\_c](./integral-c.html)<T,Finish> finish;
    //_unspecified_//_..._};

Description

range_c is a sorted Random Access Sequence of Integral Constants. Note that because it is not an Extensible Sequence, sequence-building intrinsic metafunctions such as push_front and transformation algorithms such as replace are not directly applicable — to be able to use them, you'd first need to copy the content of the range into a more suitable sequence.

#include <[boost/mpl/range\_c.hpp](../../../../boost/mpl/range_c.hpp)>

Model of

Random Access Sequence

Expression semantics

In the following table, r is an instance of range_c, n is an Integral Constant, T is an arbitrary integral type, and n and m are integral constant values of type T.

ExpressionSemantics
[range\_c](./range-c.html)\<T,n,m\>[range\_c](./range-c.html)\<T,n,m\>::type

| A sorted Random Access Sequence of integral constant wrappers for the half-open range of values [n, m): integral_c<T,n>, integral_c<T,n+1>,... integral_c<T,m-1>. | | begin<r>::type | An iterator pointing to the beginning of r; see Random Access Sequence. | | end<r>::type | An iterator pointing to the end of r; see Random Access Sequence. | | size<r>::type | The size of r; see Random Access Sequence. | | empty<r>::type | A boolean Integral Constant c such that c::value == true if and only if r is empty; see Random Access Sequence. | | front<r>::type | The first element in r; see Random Access Sequence. | | back<r>::type | The last element in r; see Random Access Sequence. | | at<r,n>::type | The nth element from the beginning of r; see Random Access Sequence. |

Example

typedef[range\_c](./range-c.html)<int,0,0> range0;
typedef[range\_c](./range-c.html)<int,0,1> range1;
typedef[range\_c](./range-c.html)<int,0,10> range10;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<range0>::value, ==, 0 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<range1>::value, ==, 1 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<range10>::value, ==, 10 );[BOOST\_MPL\_ASSERT](./assert.html)(([empty](./empty.html)<range0> ));[BOOST\_MPL\_ASSERT\_NOT](./assert-not.html)(([empty](./empty.html)<range1> ));[BOOST\_MPL\_ASSERT\_NOT](./assert-not.html)(([empty](./empty.html)<range10> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[begin](./begin.html)<range0>::type,[end](./end.html)<range0>::type > ));[BOOST\_MPL\_ASSERT\_NOT](./assert-not.html)(( is_same<[begin](./begin.html)<range1>::type,[end](./end.html)<range1>::type > ));[BOOST\_MPL\_ASSERT\_NOT](./assert-not.html)(( is_same<[begin](./begin.html)<range10>::type,[end](./end.html)<range10>::type > ));[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([front](./front.html)<range1>::type::value, ==, 0 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([back](./back.html)<range1>::type::value, ==, 0 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([front](./front.html)<range10>::type::value, ==, 0 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([back](./back.html)<range10>::type::value, ==, 9 );

See also

Sequences, Random Access Sequence, vector_c, set_c, list_c

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |