CANN/asc-devkit remove_reference类型特性

CANN/asc-devkit remove_reference类型特性 remove_reference产品支持情况产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练系列产品/Atlas A3 推理系列产品√Atlas A2 训练系列产品/Atlas A2 推理系列产品√Atlas 200I/500 A2 推理产品xAtlas 推理系列产品AI CorexAtlas 推理系列产品Vector CorexAtlas 训练系列产品x功能说明在程序编译时从给定类型中移除引用限定符包括左值引用T和右值引用T可以用于在编译时进行类型转换。函数原型template typename Tp struct remove_reference;参数说明表 1模板参数说明参数名含义Tp需要处理的类型包括基本类型如int、float等、复合类型如数组、指针、用户自定义类型如类、结构体等以及带有左值引用或右值引用限定的类型。约束说明无返回值说明remove_reference是一个结构体其提供一个嵌套类型type表示移除引用限定符后的类型。通过remove_referenceTp::type来访问该类型。调用示例// Test non-reference type ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referenceint::type, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencedouble::type, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencechar::type, char)); // Test lvalue reference type ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referenceint::type, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencedouble::type, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencechar::type, char)); // Test rvalue reference type ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referenceint::type, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencedouble::type, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_referencechar::type, char)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tint, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tdouble, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tint, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tdouble, double)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tint, int)); ascendc_assert((AscendC::Std::is_same_vAscendC::Std::remove_reference_tdouble, double));创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考