Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/copy.rst @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.9 KB

copy

Synopsis

template<
      typename Sequence
    , typename In = |unspecified|
    >
struct copy
{
    typedef |unspecified| type;
};

Description

Returns a copy of the original sequence.

|transformation algorithm disclaimer|

Parameters

Parameter Requirement Description
Sequence |Forward Sequence| A sequence to copy.
In |Inserter| An inserter.

Expression semantics

|Semantics disclaimer...| |Reversible Algorithm|.

For any |Forward Sequence| s, and an |Inserter| in:

typedef copy<s,in>::type r;
Return type:

A type.

Semantics:

Equivalent to

typedef fold< s,in::state,in::operation >::type r;

Complexity

Linear. Exactly size<s>::value applications of in::operation.

Example

typedef vector_c<int,0,1,2,3,4,5,6,7,8,9> numbers;
typedef copy<
      range_c<int,10,20>
    , back_inserter< numbers >
    >::type result;
BOOST_MPL_ASSERT_RELATION( size<result>::value, ==, 20 );
BOOST_MPL_ASSERT(( equal< result,range_c<int,0,20> > ));

Docutils System Messages

???????????????
Note: See TracBrowser for help on using the repository browser.