MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
可转换性检查

检查类型之间的转换能力 更多...

概念

concept  convertible_to
 检查类型From是否可以转换为类型To

struct  is_convertible< From, To >
 判断类型From是否可以隐式转换为类型To 更多...
struct  is_nothrow_convertible< From, To, IsConvertible, IsVoid >
 判断类型From是否可以无异常地转换为类型To 更多...
struct  is_nothrow_arrow< Iterator, Ptr, IsPtr >
 判断迭代器的箭头运算符是否不会抛出异常 更多...

类型定义

template<typename ToElement, typename FromElement>
using is_array_convertible = is_convertible<FromElement(*)[], ToElement(*)[]>
 判断数组元素类型FromElement是否可以转换为ToElement

详细描述

检查类型之间的转换能力

类型定义说明

◆ is_array_convertible

template<typename ToElement, typename FromElement>
using is_array_convertible = is_convertible<FromElement(*)[], ToElement(*)[]>

判断数组元素类型FromElement是否可以转换为ToElement

模板参数
ToElement目标元素类型
FromElement源元素类型

通过检查指向未知大小数组的指针的转换性来实现。

在文件 type_traits.hpp3206 行定义.