Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/test/push_front.cpp @ 44

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

updated boost from 1_33_1 to 1_34_1

File size: 1.2 KB
Line 
1
2// Copyright Aleksey Gurtovoy 2000-2004
3//
4// Distributed under the Boost Software License, Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7//
8// See http://www.boost.org/libs/mpl for documentation.
9
10// $Source: /cvsroot/boost/boost/libs/mpl/test/push_front.cpp,v $
11// $Date: 2004/09/02 15:41:35 $
12// $Revision: 1.4 $
13
14#include <boost/mpl/push_front.hpp>
15#include <boost/mpl/push_back.hpp>
16#include <boost/mpl/list/list10.hpp>
17#include <boost/mpl/size.hpp>
18#include <boost/mpl/front.hpp>
19
20#include <boost/mpl/aux_/test.hpp>
21
22MPL_TEST_CASE()
23{
24    typedef push_front<list0<>,long>::type res1;
25    typedef push_front<list1<long>,int>::type res2;
26    typedef push_front<list2<int,long>,char>::type res3;
27   
28    MPL_ASSERT_RELATION( size<res1>::value, ==, 1 );
29    MPL_ASSERT_RELATION( size<res2>::value, ==, 2 );
30    MPL_ASSERT_RELATION( size<res3>::value, ==, 3 );
31   
32    MPL_ASSERT(( is_same< front<res1>::type, long > ));
33    MPL_ASSERT(( is_same< front<res2>::type, int > ));
34    MPL_ASSERT(( is_same< front<res3>::type, char > ));
35   
36    MPL_ASSERT(( has_push_front< list0<> > ));
37    MPL_ASSERT(( has_push_front< list1<long> > ));
38
39    MPL_ASSERT_NOT(( has_push_back< list0<> > ));
40}
Note: See TracBrowser for help on using the repository browser.