c++ - std::is_class 的实现

标签 c++ c++11

我想知道 std::is_class ( http://www.cplusplus.com/reference/type_traits/is_class/ ) 是如何实际实现的。我查看了 /usr/include/c++/4.8/tr1/type_traits 但似乎唯一存在的是:

/// is_class
template<typename _Tp>
  struct is_class
  : public integral_constant<bool, __is_class(_Tp)>
  { };

__is_class 的定义在任何地方都找不到(或者我只是看得不够深入)。无论如何,如果有人能指出我在哪里寻找这个(以及 std 命名空间中的其他 is_***)

,我会很高兴

最佳答案

__is_class 是 gcc 编译器提供的 C++ 扩展。参见 gcc type traits .

The C++ front end implements syntactic extensions that allow compile-time determination of various characteristics of a type (or of a pair of types).

关于c++ - std::is_class 的实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25549327/

相关文章:

c++ - 调试时 Fprintf 奇怪的输出

c++ - CPPUTest 调试 - C++

c++ - [dcl.constexpr]/3 中的 contain 是什么意思

c++ - 返回没有 std::function 的 lambda

c++ - C++11 中的共享变量

C++ 11:引用无效?

c++ - 有两个不同版本的箭头运算符?

c++ - 返回 NULL 值

c++ - 如何将库添加到eclipse中

c++ - 遍历 boost::multi_array 的维度