forked from boostorg/mpl
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
|
|
#ifndef BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
|
|
#define BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
|
|
|
|
// + file: boost/mpl/integral_c.hpp
|
|
// + last modified: 08/mar/03
|
|
|
|
// Copyright (c) 2000-03
|
|
// Aleksey Gurtovoy
|
|
//
|
|
// Permission to use, copy, modify, distribute and sell this software
|
|
// and its documentation for any purpose is hereby granted without fee,
|
|
// provided that the above copyright notice appears in all copies and
|
|
// that both the copyright notice and this permission notice appear in
|
|
// supporting documentation. No representations are made about the
|
|
// suitability of this software for any purpose. It is provided "as is"
|
|
// without express or implied warranty.
|
|
//
|
|
// See http://www.boost.org/libs/mpl for documentation.
|
|
|
|
#include "boost/mpl/integral_c_fwd.hpp"
|
|
#include "boost/mpl/aux_/ice_cast.hpp"
|
|
#include "boost/mpl/aux_/config/ctps.hpp"
|
|
#include "boost/mpl/aux_/config/workaround.hpp"
|
|
|
|
#if BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800))
|
|
// the type of non-type template arguments may not depend on template arguments
|
|
# define AUX_WRAPPER_PARAMS(N) typename T, long N
|
|
#else
|
|
# define AUX_WRAPPER_PARAMS(N) typename T, T N
|
|
#endif
|
|
|
|
#define AUX_WRAPPER_NAME integral_c
|
|
#define AUX_WRAPPER_VALUE_TYPE T
|
|
#define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< T, value >
|
|
#include "boost/mpl/aux_/integral_wrapper.hpp"
|
|
|
|
|
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
|
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
|
|
namespace boost { namespace mpl {
|
|
// 'bool' constant doesn't have 'next'/'prior' members
|
|
template< bool C >
|
|
struct integral_c<bool, C>
|
|
{
|
|
BOOST_STATIC_CONSTANT(bool, value = C);
|
|
typedef integral_c type;
|
|
operator bool() const { return this->value; }
|
|
};
|
|
}}
|
|
#endif
|
|
|
|
#endif // BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
|