当前位置: 首页 > article >正文

C++之type traits

目录

  • 帮助类
    • std::integral_constant
    • bool_constant
  • 主要类型分类
    • std::is_void
    • is_null_pointer
    • is_integral
    • is_floating_point
    • is_array
    • is_enum
    • is_union
    • is_class
    • is_function
    • is_pointer
    • is_lvalue_reference
    • is_rvalue_reference
    • is_member_object_pointer
    • is_member_function_pointer
  • 组合类型分类
    • is_fundamental
    • is_arithmetic
    • is_scalar
    • is_object
    • is_compound
    • is_reference
    • is_member_pointer
  • 类型属性
    • is_const
    • is_volatile
    • is_trivial
    • is_trivially_copyable
    • is_standard_layout
    • is_empty
    • is_polymorphic
    • is_abstract
    • is_final
    • is_aggregate
    • is_signed
    • is_unsigned
  • 支持的操作
    • 构造
    • 析构
    • 拷贝构造
    • 移动构造
    • 特定参数的赋值运算符
    • 拷贝赋值运操作
    • 移动赋值操作
    • 是否有未删除的析构
    • 是否有虚析构
  • 属性查询
    • alignment_of
    • rank
    • extent
  • 类型关系
    • is_same
    • is_base_of
    • is_convertible/is_nothrow_convertible
  • Const-volatility属性
    • 删除cv属性
    • 添加cv属性
  • 引用
    • remove_reference
    • add_lvalue_reference
    • add_rvalue_reference
  • 指针
    • remove_pointer
    • add_pointer
  • 符号修饰符
    • make_signed
    • make_unsigned
  • 数组
    • remove_extent
    • remove_all_extents
  • 不同类型转换
    • aligned_storage
    • aligned_union
    • decay
    • remove_cvref
    • enable_if
    • conditional
    • common_type
    • underlying_type

Type traits在C++中,尤其是模板中应用极为广泛。头文件: #include<type_traits>

帮助类

std::integral_constant

bool_constant

主要类型分类

std::is_void

is_null_pointer

is_integral

is_floating_point

is_array

is_enum

is_union

is_class

is_function

is_pointer

is_lvalue_reference

is_rvalue_reference

is_member_object_pointer

is_member_function_pointer

组合类型分类

is_fundamental

is_arithmetic

is_scalar

is_object

is_compound

is_reference

is_member_pointer

类型属性

is_const

is_volatile

is_trivial

is_trivially_copyable

is_standard_layout

is_empty

is_polymorphic

is_abstract

is_final

is_aggregate

is_signed

is_unsigned

支持的操作

构造

is_constructible
is_trivially_constructible
is_nothrow_constructible

析构

is_default_constructible
is_trivially_default_constructible
is_nothrow_default_constructible

拷贝构造

is_copy_constructible
is_trivially_copy_constructible
is_nothrow_copy_constructible

移动构造

is_move_constructible
is_trivially_move_constructible
is_nothrow_move_constructible

特定参数的赋值运算符

is_assignable
is_trivially_assignable
is_nothrow_assignable

拷贝赋值运操作

is_copy_assignable
is_trivially_copy_assignable
is_nothrow_copy_assignable

移动赋值操作

is_move_assignable
is_trivially_move_assignable
is_nothrow_move_assignable

是否有未删除的析构

is_destructible
is_trivially_destructible
is_nothrow_destructible

是否有虚析构

has_virtual_destructor

属性查询

alignment_of

rank

extent

类型关系

is_same

is_base_of

is_convertible/is_nothrow_convertible

Const-volatility属性

删除cv属性

remove_cv
remove_const
remove_volatile

添加cv属性

add_cv
add_const
add_volatile

引用

remove_reference

add_lvalue_reference

add_rvalue_reference

指针

remove_pointer

add_pointer

符号修饰符

make_signed

make_unsigned

数组

remove_extent

remove_all_extents

不同类型转换

aligned_storage

aligned_union

decay

remove_cvref

enable_if

conditional

common_type

underlying_type


http://www.kler.cn/news/137252.html

相关文章:

  • java:简单入门定时任务的几种方式Timer、Quartz、Spring Task
  • Open AI开发者大会:AI“科技春晚”
  • 使用SpringBoot开发一个API网关
  • 设计模式(二)-创建者模式(4)-原型模式
  • 纽扣电池/含纽扣电池产品上架亚马逊各国法规标准要求16 CFR 第 1700.15/20 ANSI C18.3M(瑞西法案认证)
  • vue-awesome-swiper 引入css样式文件报错等问题
  • 前端语言报错
  • 黑马React18: 基础Part II
  • 部署Kubernetes Dashboard
  • 创建域名邮箱邮件地址的方法与步骤
  • vue动态获取目录结构进行配置静态路由
  • Android项目更新依赖和打包步骤和问题汇总
  • 本地部署 EmotiVoice易魔声 多音色提示控制TTS
  • zookeeper应用之分布式队列
  • 百度地图,地市区域描边
  • HTML+CSS+ElementUI搭建个人博客页面(纯前端)
  • 基于STM32CubeMX和keil采用RTC时钟周期唤醒和闹钟实现LED与BEEP周期开关
  • LeetCode977.有序数组的平方(双指针法、暴力法、列表推导式)
  • Linux CentOS 8(DNS的配置与管理)
  • 【发明专利】天洑软件再度收获六项国家发明专利授权