• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MPL_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MPL_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ MPL_ASSERT函数的具体用法?C++ MPL_ASSERT怎么用?C++ MPL_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MPL_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef set0<> s;
    
    MPL_ASSERT_RELATION( size<s>::value, ==, 0 );
    MPL_ASSERT(( empty<s> ));
    MPL_ASSERT(( is_same< clear<s>::type, set0<> > ));
    MPL_ASSERT(( is_same< at<s,char>::type, void_ > ));

    MPL_ASSERT_NOT(( has_key<s,char> ));
    MPL_ASSERT_NOT(( has_key<s,int> ));
    MPL_ASSERT_NOT(( has_key<s,UDT> ));
    MPL_ASSERT_NOT(( has_key<s,incomplete> ));

    MPL_ASSERT_NOT(( has_key<s,char const> ));
    MPL_ASSERT_NOT(( has_key<s,int const> ));
    MPL_ASSERT_NOT(( has_key<s,UDT const> ));
    MPL_ASSERT_NOT(( has_key<s,incomplete const> ));

    MPL_ASSERT_NOT(( has_key<s,int*> ));
    MPL_ASSERT_NOT(( has_key<s,UDT*> ));
    MPL_ASSERT_NOT(( has_key<s,incomplete*> ));

    MPL_ASSERT_NOT(( has_key<s,int&> ));
    MPL_ASSERT_NOT(( has_key<s,UDT&> ));
    MPL_ASSERT_NOT(( has_key<s,incomplete&> ));

    typedef insert<s,char>::type s1;
    MPL_ASSERT_RELATION( size<s1>::value, ==, 1 );
    MPL_ASSERT(( is_same< at<s1,char>::type, char > ));

    typedef erase_key<s,char>::type s0_1;
    MPL_ASSERT_RELATION( size<s0_1>::value, ==, 0 );
    MPL_ASSERT(( is_same< at<s0_1,char>::type, void_ > ));
}
开发者ID:edwardotis,项目名称:hivm,代码行数:35,代码来源:set.cpp


示例2: MPL_TEST_CASE

MPL_TEST_CASE() // fully bound metafunction classes
{
    typedef apply_wrap0< bind1<f1,int> >::type r11;
    typedef apply_wrap0< bind5<f5,void,void,void,void,int> >::type r51;
    MPL_ASSERT(( boost::is_same<r11,int> ));
    MPL_ASSERT(( boost::is_same<r51,int> ));
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:7,代码来源:bind.cpp


示例3: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef apply1< make_identity<>, char >::type t1;
    typedef apply1< make_identity<_1>, int >::type t2;
    MPL_ASSERT(( is_same< t1, identity<char> > ));
    MPL_ASSERT(( is_same< t2, identity<int> > ));
}
开发者ID:AndroidAppList,项目名称:Android-Supertux,代码行数:7,代码来源:identity.cpp


示例4: MPL_TEST_CASE

MPL_TEST_CASE()
{
    MPL_ASSERT(( is_same< mpl::aux::largest_int<bool,bool>::type, bool > ));
    MPL_ASSERT(( is_same< mpl::aux::largest_int<bool,char>::type, char > ));
    MPL_ASSERT(( is_same< mpl::aux::largest_int<char,bool>::type, char > ));
    MPL_ASSERT(( is_same< mpl::aux::largest_int<int,unsigned>::type, unsigned > ));
    MPL_ASSERT(( is_same< mpl::aux::largest_int<unsigned,long>::type, long > ));
}
开发者ID:Alexander--,项目名称:Wesnoth-1.8-for-Android,代码行数:8,代码来源:largest_int.cpp


示例5: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef always<true_> always_true;

    MPL_ASSERT(( apply< always_true,false_ > ));
    MPL_ASSERT(( apply< always_true,false_,false_ > ));
    MPL_ASSERT(( apply< always_true,false_,false_,false_ > ));
}
开发者ID:cppljevans,项目名称:variadic_templates,代码行数:8,代码来源:always.cpp


示例6: MPL_TEST_CASE

MPL_TEST_CASE()
{
    MPL_ASSERT(( is_same< mpl::min< int_<5>,int_<7> >::type,int_<5> > ));
    MPL_ASSERT(( is_same< mpl::max< int_<5>,int_<7> >::type,int_<7> > ));

    MPL_ASSERT(( is_same< mpl::min< int_<-5>,int_<-7> >::type,int_<-7> > ));
    MPL_ASSERT(( is_same< mpl::max< int_<-5>,int_<-7> >::type,int_<-5> > ));
}
开发者ID:BwRy,项目名称:core-android-market,代码行数:8,代码来源:min_max.cpp


示例7: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef quote1<f1>::apply<int>::type t1;
    typedef quote5<f5>::apply<char,short,int,long,float>::type t5;
    
    MPL_ASSERT(( boost::is_same< t1, int > ));
    MPL_ASSERT(( boost::is_same< t5, f5<char,short,int,long,float> > ));
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:8,代码来源:quote.cpp


示例8: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef mpl::advance<last,int_<-10> >::type iter1;
    typedef advance_c<last,-10>::type           iter2;

    MPL_ASSERT(( is_same<iter1, first> ));
    MPL_ASSERT(( is_same<iter2, first> ));
}
开发者ID:darwin,项目名称:boost,代码行数:8,代码来源:advance.cpp


示例9: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef stable_partition<
          numbers
        , greater_equal< _, int_<3> >
        >::type result;

    MPL_ASSERT(( equal< result::first,manual_second > ));
    MPL_ASSERT(( equal< result::second,manual_first > ));
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:10,代码来源:stable_partition.cpp


示例10: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef list<> l0;

    typedef push_front<l0,char>::type l1;
    MPL_ASSERT(( is_same<front<l1>::type,char> ));

    typedef push_front<l1,long>::type l2;
    MPL_ASSERT(( is_same<front<l2>::type,long> ));
}
开发者ID:cppljevans,项目名称:variadic_templates,代码行数:10,代码来源:list.cpp


示例11: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef list_c<bool,true>::type l1;
    typedef list_c<bool,false>::type l2;

    MPL_ASSERT(( is_same< l1::value_type, bool > ));
    MPL_ASSERT(( is_same< l2::value_type, bool > ));

    MPL_ASSERT_RELATION( front<l1>::type::value, ==, true );
    MPL_ASSERT_RELATION( front<l2>::type::value, ==, false );
}
开发者ID:darwin,项目名称:boost,代码行数:11,代码来源:list_c.cpp


示例12: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef int_<0> _0;
    typedef int_<1> _1;
    typedef int_<2> _2;

    MPL_ASSERT(( is_same< next<_0>::type, _1 > ));
    MPL_ASSERT(( is_same< next<_1>::type, _2 > ));
    MPL_ASSERT(( is_same< prior<_1>::type, _0 > ));
    MPL_ASSERT(( is_same< prior<_2>::type, _1 > ));
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:11,代码来源:next.cpp


示例13: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef vector_c<bool,true>::type v1;
    typedef vector_c<bool,false>::type v2;

    MPL_ASSERT(( is_same< v1::value_type, bool > ));
    MPL_ASSERT(( is_same< v2::value_type, bool > ));

    MPL_ASSERT_RELATION( front<v1>::type::value, ==, true );
    MPL_ASSERT_RELATION( front<v2>::type::value, ==, false );
}
开发者ID:avasopht,项目名称:boost_1_55_0-llvm,代码行数:11,代码来源:vector_c.cpp


示例14: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef vector2<char,long> v2;
    
    typedef begin<v2>::type i1;
    typedef next<i1>::type  i2;
    typedef next<i2>::type  i3;
    
    MPL_ASSERT(( is_same<deref<i1>::type,char> ));
    MPL_ASSERT(( is_same<deref<i2>::type,long> ));
    MPL_ASSERT(( is_same< i3, end<v2>::type > ));
}
开发者ID:AndroidAppList,项目名称:Android-Supertux,代码行数:12,代码来源:vector.cpp


示例15: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef deque<char,long> d2;
    
    typedef begin<d2>::type i1;
    typedef next<i1>::type  i2;
    typedef next<i2>::type  i3;
    
    MPL_ASSERT(( is_same<deref<i1>::type,char> ));
    MPL_ASSERT(( is_same<deref<i2>::type,long> ));
    MPL_ASSERT(( is_same< i3, end<d2>::type > ));
}
开发者ID:BwRy,项目名称:core-android-market,代码行数:12,代码来源:deque.cpp


示例16: MPL_TEST_CASE

MPL_TEST_CASE()
{
  typedef enum_range_c<EC3,0,1> range1;
  typedef enum_range_c<EC3> range3;

//    MPL_ASSERT_RELATION( back<range1>::type::value, ==, EC3::Enum0 );
//    MPL_ASSERT_RELATION( back<range3>::type::value, ==, EC3::Enum2 );
    MPL_ASSERT(( is_same< enum_c<EC3,back<range1>::type::value>,
        enum_c<EC3,EC3::Enum0> > ));
    MPL_ASSERT(( is_same< enum_c<EC3,back<range3>::type::value>,
        enum_c<EC3,EC3::Enum2> > ));
}
开发者ID:viboes,项目名称:enums,代码行数:12,代码来源:back.pass.cpp


示例17: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef eval_if< true_, identity<char>, identity<long> >::type t1;
    typedef eval_if_c< true, identity<char>, identity<long> >::type t2;
    typedef eval_if< false_, identity<char>, identity<long> >::type t3;
    typedef eval_if_c< false, identity<char>, identity<long> >::type t4;

    MPL_ASSERT(( is_same<t1,char> ));
    MPL_ASSERT(( is_same<t2,char> ));
    MPL_ASSERT(( is_same<t3,long> ));
    MPL_ASSERT(( is_same<t4,long> ));
}
开发者ID:BwRy,项目名称:core-android-market,代码行数:12,代码来源:eval_if.cpp


示例18: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef begin<empty_sequence>::type begin;
    typedef end<empty_sequence>::type end;

    MPL_ASSERT(( is_same<begin,end> ));
    MPL_ASSERT_RELATION( (mpl::distance<begin,end>::value), ==, 0 );
    MPL_ASSERT_RELATION( size<empty_sequence>::value, ==, 0 );

    typedef advance_c<begin,0>::type advanced;
    MPL_ASSERT(( is_same<advanced,end> ));
}
开发者ID:OggYiu,项目名称:rag-engine,代码行数:12,代码来源:empty_sequence.cpp


示例19: MPL_TEST_CASE

MPL_TEST_CASE()
{
    MPL_ASSERT_NOT(( is_sequence< std_vector<int> > ));
    MPL_ASSERT_NOT(( is_sequence< int_<0> > ));
    MPL_ASSERT_NOT(( is_sequence< int > ));
    MPL_ASSERT_NOT(( is_sequence< int& > ));
    MPL_ASSERT_NOT(( is_sequence< UDT > ));
    MPL_ASSERT_NOT(( is_sequence< UDT* > ));
    MPL_ASSERT(( is_sequence< range_c<int,0,0> > ));
    MPL_ASSERT(( is_sequence< list<> > ));
    MPL_ASSERT(( is_sequence< list<int> > ));
    MPL_ASSERT(( is_sequence< vector<> > ));
    MPL_ASSERT(( is_sequence< vector<int> > ));
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:14,代码来源:is_sequence.cpp


示例20: MPL_TEST_CASE

MPL_TEST_CASE()
{
    typedef enum_range_c<EC3> r;
    typedef begin<r>::type first;
    typedef end<r>::type last;

    MPL_ASSERT(( is_same< advance_c<first,3>::type, last > ));
    MPL_ASSERT(( is_same< advance_c<last,-3>::type, first > ));

    MPL_ASSERT_RELATION( ( mpl::distance<first,last>::value ), ==, 3 );

//    typedef advance_c<first,5>::type iter;
//    MPL_ASSERT_RELATION( deref<iter>::type::value, ==, 5 );
}
开发者ID:viboes,项目名称:enums,代码行数:14,代码来源:enum_range_c.pass.cpp



注:本文中的MPL_ASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MPL_LOGV函数代码示例发布时间:2022-05-30
下一篇:
C++ MPLS_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap