官方说明中核心语句: 如果本身就是const类型或者引用类型或者函数类型,则保持不变; 其他场景变成T const
官方说明: add_const - C++ Reference
#include <iostream>
#include <type_traits>
#include <functional>
using forward_func = std::function<int(int)>;
typedef int(func_point_type)(int);
typedef int(func_point_type_const)(const int);
typedef std::add_const<forward_func>::type func_add_const;
typedef std::add_const<func_point_type>::type func_point_type_add_const;
typedef std::add_const<int>::type int_add_const;
typedef std::add_const<const int>::type const_int_add_const;
typedef std::add_const<int&>::type int_ref_add_const;
typedef std::add_const<const int&>::type const_int_ref_add_const;
typedef std::add_const<int*>::type int_point_add_const;
typedef std::add_const<const i