首页 > 代码库 > C++ 11标准STL中Traits的is_pointer的实现

C++ 11标准STL中Traits的is_pointer的实现

在看STL的源码,发现is_pointer的模板调用,写了一个测试代码如下:

#include <iostream>
#include <type_traits>

using namespace::std;


namespace iotek{
	template<typename _Tp, _Tp __v>
    struct integral_constant
    {
      static constexpr _Tp                  value = http://www.mamicode.com/__v;>编译使用如下命令:

gcc -std=c++11 -o test is_pointer.cpp



C++ 11标准STL中Traits的is_pointer的实现