Get the signed/unsigned variant of an integer template parameter without explicit traits

杀马特。学长 韩版系。学妹 提交于 2019-12-03 04:55:15
Terry Mahaffey

The answer is in <type_traits>

For determining the signed-ness of a type use std::is_signed and std::is_unsigned.

For adding/removing signed-ness, there is std::make_signed and std::make_unsigned.

If you can't or don't want to depend on TR1/C++0x features, Boost.TypeTraits also offers you make_unsigned<> et al.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!