⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 integral_wrapper_test.hpp

📁 C++的一个好库。。。现在很流行
💻 HPP
字号:

// 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: /cvsroot/boost/boost/libs/mpl/test/integral_wrapper_test.hpp,v $
// $Date: 2004/10/13 14:27:35 $
// $Revision: 1.3 $

#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/aux_/test.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>

#include <cassert>

#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
#   define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
    assert(( WRAPPER(T,i)() == i )); \
    assert(( WRAPPER(T,i)::value == i )); \
    /**/
#else
#   define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
    assert(( WRAPPER(T,i)::value == i )); \
    /**/
#endif

#define INTEGRAL_WRAPPER_TEST(unused1, i, T) \
    { MPL_ASSERT(( is_same< WRAPPER(T,i)::value_type, T > )); } \
    { MPL_ASSERT(( is_same< WRAPPER(T,i)::type, WRAPPER(T,i) > )); } \
    { MPL_ASSERT(( is_same< next< WRAPPER(T,i) >::type, WRAPPER(T,i+1) > )); } \
    { MPL_ASSERT(( is_same< prior< WRAPPER(T,i) >::type, WRAPPER(T,i-1) > )); } \
    { MPL_ASSERT_RELATION( (WRAPPER(T,i)::value), ==, i ); } \
    INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
/**/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -