Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/test/inherit.cpp @ 29

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

updated boost from 1_33_1 to 1_34_1

File size: 1.2 KB
RevLine 
[29]1
2// Copyright Aleksey Gurtovoy 2001-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/inherit.cpp,v $
11// $Date: 2004/09/02 15:41:35 $
12// $Revision: 1.3 $
13
14#include <boost/mpl/inherit.hpp>
15#include <boost/mpl/aux_/test.hpp>
16
17struct her { typedef her herself; };
18struct my { typedef my myself; };
19
20MPL_TEST_CASE()
21{
22    MPL_ASSERT(( is_same<inherit<her>::type, her> ));
23
24    typedef inherit<her,my>::type her_my1;
25    MPL_ASSERT(( is_same<her_my1::herself, her> ));
26    MPL_ASSERT(( is_same<her_my1::myself, my> ));
27   
28    typedef inherit<empty_base,her>::type her1;
29    MPL_ASSERT(( is_same<her1, her> ));
30   
31    typedef inherit<empty_base,her,empty_base,empty_base>::type her2;
32    MPL_ASSERT(( is_same<her2, her> ));
33
34    typedef inherit<her,empty_base,my>::type her_my2;
35    MPL_ASSERT(( is_same<her_my2::herself, her> ));
36    MPL_ASSERT(( is_same<her_my2::myself, my> ));
37
38    typedef inherit<empty_base,empty_base>::type empty;
39    MPL_ASSERT(( is_same<empty, empty_base> ));
40}
Note: See TracBrowser for help on using the repository browser.