]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/test/inherit.cpp
2 // Copyright Aleksey Gurtovoy 2001-2004
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)
8 // See http://www.boost.org/libs/mpl for documentation.
14 #include <boost/mpl/inherit.hpp>
15 #include <boost/mpl/aux_/test.hpp>
17 struct her
{ typedef her herself
; };
18 struct my
{ typedef my myself
; };
22 MPL_ASSERT(( is_same
<inherit
<her
>::type
, her
> ));
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
> ));
28 typedef inherit
<empty_base
,her
>::type her1
;
29 MPL_ASSERT(( is_same
<her1
, her
> ));
31 typedef inherit
<empty_base
,her
,empty_base
,empty_base
>::type her2
;
32 MPL_ASSERT(( is_same
<her2
, her
> ));
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
> ));
38 typedef inherit
<empty_base
,empty_base
>::type empty
;
39 MPL_ASSERT(( is_same
<empty
, empty_base
> ));