Compare typedef is same type

后端 未结 3 1184
情歌与酒
情歌与酒 2020-12-17 23:25

I am using C++ (not 11) and using some libraries which have different typedefs for integer data types. Is there any way I can assert that two typedefs are the same type? I\'

3条回答
  •  情书的邮戳
    2020-12-17 23:56

    Since you don't have C++11, use boost.

    BOOST_STATIC_ASSERT(boost::is_same::value);
    

    You can write some kind of your assert function, instead of BOOST_STATIC_ASSERT.

提交回复
热议问题