1 |
|
---|
2 | #ifndef BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
|
---|
3 | #define BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
|
---|
4 |
|
---|
5 | // Copyright Aleksey Gurtovoy 2001-2004
|
---|
6 | //
|
---|
7 | // Distributed under the Boost Software License, Version 1.0.
|
---|
8 | // (See accompanying file LICENSE_1_0.txt or copy at
|
---|
9 | // http://www.boost.org/LICENSE_1_0.txt)
|
---|
10 | //
|
---|
11 | // See http://www.boost.org/libs/mpl for documentation.
|
---|
12 |
|
---|
13 | // $Source: /cvsroot/boost/boost/boost/mpl/empty_base.hpp,v $
|
---|
14 | // $Date: 2004/09/02 15:40:41 $
|
---|
15 | // $Revision: 1.4 $
|
---|
16 |
|
---|
17 | #include <boost/mpl/bool.hpp>
|
---|
18 | #include <boost/mpl/aux_/config/msvc.hpp>
|
---|
19 | #include <boost/mpl/aux_/config/workaround.hpp>
|
---|
20 |
|
---|
21 | #include <boost/type_traits/is_empty.hpp>
|
---|
22 |
|
---|
23 | // should be always the last #include directive
|
---|
24 | #include <boost/type_traits/detail/bool_trait_def.hpp>
|
---|
25 |
|
---|
26 | namespace boost { namespace mpl {
|
---|
27 |
|
---|
28 | // empty base class, guaranteed to have no members; inheritance from
|
---|
29 | // 'empty_base' through the 'inherit' metafunction is a no-op - see
|
---|
30 | // "mpl/inherit.hpp> header for the details
|
---|
31 | struct empty_base {};
|
---|
32 |
|
---|
33 | template< typename T >
|
---|
34 | struct is_empty_base
|
---|
35 | : false_
|
---|
36 | {
|
---|
37 | #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
---|
38 | using false_::value;
|
---|
39 | #endif
|
---|
40 | };
|
---|
41 |
|
---|
42 | template<>
|
---|
43 | struct is_empty_base<empty_base>
|
---|
44 | : true_
|
---|
45 | {
|
---|
46 | #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
---|
47 | using true_::value;
|
---|
48 | #endif
|
---|
49 | };
|
---|
50 |
|
---|
51 | }}
|
---|
52 |
|
---|
53 | namespace boost {
|
---|
54 | BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true)
|
---|
55 | }
|
---|
56 |
|
---|
57 | #include <boost/type_traits/detail/bool_trait_undef.hpp>
|
---|
58 |
|
---|
59 | #endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
|
---|