首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::has_unique_object_representations

Defined in header <type_traits>

template< class T > struct has_unique_object_representations;

(since C++17)

如果TTriviallyCopyable如果任何两个类型的对象T具有相同的值有相同的对象表示,提供成员常量。value平等true.对于任何其他类型,valuefalse...

为了实现这一特性,如果两个数组的元素具有相同的值,则两个数组的值相同;如果两个非并类的直接子对象具有相同的值,则两个非并类的值相同。如果两个工会具有相同的活动成员,并且该成员的值是相同的,那么它们的值是相同的。

实现定义了哪些标量类型满足这一特性,但是不使用填充位的无符号整数类型保证具有唯一的对象表示形式。

如果T是%28以外的不完整类型(可能是cv-合格%29)。void或者是未知界限的数组。

模板参数

T

-

a type to check

辅助变量模板

template< class T > inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<T>::value;

(since C++17)

继承自STD:积分[医]常量

成员常数

value static

true if T has unique object representations , false otherwise (public static member constant)

成员函数

operator bool

converts the object to bool, returns value (public member function)

operator() (C++14)

returns value (public member function)

成员类型

Type

Definition

value_type

bool

type

std::integral_constant<bool, value>

注记

引入此特性是为了确定类型是否可以通过将其对象表示为字节数组来正确散列。

另见

is_standard_layout (C++11)

checks if a type is standard-layout type (class template)

hash (C++11)

hash function object (class template)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券