C ++类型特征概述 [英] C++ Type Traits Overview

查看:108
本文介绍了C ++类型特征概述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人放在一起都提供标准类型的单子< type_traits> (GCC-4.6.1),并加速自身的 <升压/ type_traits.hpp>

Has anybody put together a list of all the type traits available in standard <type_traits> (GCC-4.6.1) and Boost's own <boost/type_traits.hpp>?

推荐答案

特性的完整列表可在网上:

The full lists of traits are available online:


  • 升压文档列出的性状<一个href=\"http://www.boost.org/doc/libs/1_47_0/libs/type_traits/doc/html/boost_typetraits/reference.html\"相对=nofollow> &LT;升压/ type_traits.hpp&GT; ;

  • 的的C ++ 0x草案列出的 &LT; type_traits方式&gt;

不过,GCC实现尚未完成。 GCC 4.6丢失:

However, the GCC implementation is not yet complete. GCC 4.6 is missing:


  • 的std :: underlying_type 特质。这将是一个对GCC 4.7。

  • 的std :: is_trivially_X 系列特质。相反,它具有的std :: has_​​trivial_default_constructor 和类似的,似乎从以前的草案有名字。有关移动构造函数的一遗漏。

  • 的std :: is_nothrow_X 系列特质。这些也使用旧名称,比如的std :: has_​​nothrow_default_constructor 。对这一举动的构造缺少一个了。

  • 的std :: aligned_union 特质。这可以在的std :: aligned_storage 而言,这是目前支持可以轻松实现。

  • The std::underlying_type trait. This one will be on GCC 4.7.
  • The std::is_trivially_X series of traits. Instead it has std::has_trivial_default_constructor and similar that seem to have the name from an earlier draft. The one about the move constructor is missing.
  • The std::is_nothrow_X series of traits. These also use an older name like std::has_nothrow_default_constructor. The one about the move constructor is missing too.
  • The std::aligned_union trait. This one can be easily implemented in terms of std::aligned_storage, which is currently supported.

这篇关于C ++类型特征概述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆