Files

31 lines
1.3 KiB
C++

// static_assert.hpp --------------------------------------------------------------//
// Copyright 2009-2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef ACTIV_BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP
#define ACTIV_BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP
#include <ActivBoost/chrono/config.hpp>
#ifndef ACTIV_BOOST_NO_CXX11_STATIC_ASSERT
#define ACTIV_BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
#elif defined(ACTIV_BOOST_CHRONO_USES_STATIC_ASSERT)
#include <ActivBoost/static_assert.hpp>
#define ACTIV_BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) ACTIV_BOOST_STATIC_ASSERT(CND)
#elif defined(ACTIV_BOOST_CHRONO_USES_MPL_ASSERT)
#include <ActivBoost/mpl/assert.hpp>
#include <ActivBoost/mpl/bool.hpp>
#define ACTIV_BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) \
ACTIV_BOOST_MPL_ASSERT_MSG(Boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
#else
//~ #elif defined(ACTIV_BOOST_CHRONO_USES_ARRAY_ASSERT)
#define ACTIV_BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static char ACTIV_BOOST_JOIN(boost_chrono_test_,__LINE__)[(CND)?1:-1]
//~ #define ACTIV_BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES)
#endif
#endif // ACTIV_BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP