Files
boost_mpl/include/boost/mpl/empty_base.hpp
T

60 lines
1.3 KiB
C++
Raw Normal View History

2002-11-15 11:54:04 +00:00
#ifndef BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
#define BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
2004-09-02 15:41:37 +00:00
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/type_traits/is_empty.hpp>
2002-11-15 11:54:04 +00:00
// should be always the last #include directive
2004-09-02 15:41:37 +00:00
#include <boost/type_traits/detail/bool_trait_def.hpp>
2002-11-15 11:54:04 +00:00
2004-09-02 15:41:37 +00:00
namespace boost { namespace mpl {
2002-11-15 11:54:04 +00:00
// empty base class, guaranteed to have no members; inheritance from
// 'empty_base' through the 'inherit' metafunction is a no-op - see
2004-09-02 15:41:37 +00:00
// "mpl/inherit.hpp> header for the details
2002-11-15 11:54:04 +00:00
struct empty_base {};
template< typename T >
struct is_empty_base
2003-02-25 23:11:41 +00:00
: false_
2002-11-15 11:54:04 +00:00
{
2004-09-02 15:41:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
2003-02-25 23:11:41 +00:00
using false_::value;
2002-11-15 11:54:04 +00:00
#endif
};
template<>
struct is_empty_base<empty_base>
2003-02-25 23:11:41 +00:00
: true_
2002-11-15 11:54:04 +00:00
{
2004-09-02 15:41:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
2003-02-25 23:11:41 +00:00
using true_::value;
2002-11-15 11:54:04 +00:00
#endif
};
2004-09-02 15:41:37 +00:00
}}
2002-11-15 11:54:04 +00:00
2004-09-02 15:41:37 +00:00
namespace boost {
2002-11-15 11:54:04 +00:00
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true)
2004-09-02 15:41:37 +00:00
}
2002-11-15 11:54:04 +00:00
2004-09-02 15:41:37 +00:00
#include <boost/type_traits/detail/bool_trait_undef.hpp>
2002-11-15 11:54:04 +00:00
#endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED