Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/test/copy.cpp @ 33

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

updated boost from 1_33_1 to 1_34_1

File size: 1.3 KB
Line 
1
2// Copyright Aleksey Gurtovoy 2000-2004
3// Copyright David Abrahams 2003-2004
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9// See http://www.boost.org/libs/mpl for documentation.
10
11// $Source: /cvsroot/boost/boost/libs/mpl/test/copy.cpp,v $
12// $Date: 2004/09/02 15:41:35 $
13// $Revision: 1.4 $
14
15#include <boost/mpl/copy.hpp>
16
17#include <boost/mpl/vector/vector20_c.hpp>
18#include <boost/mpl/vector/vector0.hpp>
19#include <boost/mpl/range_c.hpp>
20#include <boost/mpl/front_inserter.hpp>
21#include <boost/mpl/size.hpp>
22#include <boost/mpl/equal.hpp>
23#include <boost/mpl/aux_/test.hpp>
24
25MPL_TEST_CASE()
26{
27    typedef vector10_c<int,9,8,7,6,5,4,3,2,1,0> answer;
28    typedef copy<
29          range_c<int,0,10>
30        , mpl::front_inserter< vector0<> >
31        >::type result;
32
33    MPL_ASSERT_RELATION( size<result>::value, ==, 10 );
34    MPL_ASSERT(( equal< result,answer > ));
35}
36
37MPL_TEST_CASE()
38{
39    typedef vector10_c<int,10,11,12,13,14,15,16,17,18,19> numbers;
40    typedef reverse_copy<
41          range_c<int,0,10>
42        , mpl::front_inserter<numbers>
43        >::type result;
44
45    MPL_ASSERT_RELATION( size<result>::value, ==,  20 );
46    MPL_ASSERT(( equal< result,range_c<int,0,20> > ));
47}
Note: See TracBrowser for help on using the repository browser.