函数 hash< ara::core::Monostate [SWS_CORE_01671]
size_t operator() (ara::core::Monostate const &v) const noexcept;
Invoke the hashing function
使用
特化 std::hash<ara::core::Monostate> 的函数 operator() 同步计算传入的 ara::core::Monostate 对象的哈希值 [SWS_CORE_01671]。要进行访问,必须包含头文件 #include "ara/core/variant.h" [SWS_CORE_01671]。该调用通过签名 size_t operator() (ara::core::Monostate const &v) const noexcept 进行,接收对 monostate 值的常量引用,并将结果作为 size_t 返回 [SWS_CORE_01671]。
错误处理与异常安全性
该操作被显式声明为 noexcept,并归类为异常安全(exception safe)[SWS_CORE_01671]。未定义特定错误码或 DET/DEM 报告;调用不会失败,并保证不会抛出异常。
并发性与交互
作为无副作用的 const 成员函数,该调用具有可重入性,并且对于来自多个线程的并发访问完全安全。由于 ara::core::Monostate 表示空状态类型,因此计算得出的哈希值对于所有实例大概是相同的。 问题 Q-8cbc0fc2662e1943 (未决)该特化大概用于无缝支持 ara::core::Monostate 或包含该类型的 variant 作为哈希型标准容器(如 std::unordered_set)中的键。
本使用说明基于规范 R25-11 自动生成。
实现者指南即将推出(复杂度 I1)
| Header-Datei | #include "ara/core/variant.h" |
|---|---|
| Scope | struct std::hash< ara::core::Monostate > |
| Exception-Sicherheit | exception safe |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CORE_01671- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CORE_01671@rel:R25-11#e1bd15d3- Content hash
e1bd15d3- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_01671
Status: valid/unmigrated
Version: rel:R25-11#f23dc3e8
Versionshistorie & Revisions (1 transition, 3 revision)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_CORE_01671@rel:R25-11#f23dc3e8
Recorded Revisions (3):
- R25-11
rel:R25-11#71dc5cdc2026-09-30 - R24-11
rel:R24-11#f5ed16732026-10-14 - R25-11
rel:R25-11#f23dc3e82026-10-14 active
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · 德文原文