函数 hash< ara::core::Optional< T [SWS_CORE_01199]
size_t operator() (ara::core::Optional< T > const &v) const noexcept;
Invoke the hashing function
特化 struct std::hash<ara::core::Optional<T>> 用于根据 [SWS_CORE_01199] 计算类型为 ara::core::Optional<T> 的可选对象的哈希值。它使得 ara::core::Optional<T> 可以直接用作诸如 std::unordered_map 或 std::unordered_set 等未存储或基于哈希的标准容器中的键类型。
使用
该调用通过头文件 #include "ara/core/optional.h" 中声明的函数调用运算符 operator() 同步执行([SWS_CORE_01199]):
- 参数:可选对象
v作为常量引用ara::core::Optional<T> const &传入([SWS_CORE_01199])。 - 返回值:类型为
size_t的哈希值([SWS_CORE_01199])。 - 语义:该调用针对传入的实例执行哈希函数([SWS_CORE_01199])。
错误处理与异常安全性
根据 [SWS_CORE_01199],该操作被声明为 noexcept,并被视为异常安全(exception safe)。不存在特定的 AUTOSAR 错误码或向错误钩子(如 DET 或 DEM)的报告,因为计算是无故障且无异常执行的([SWS_CORE_01199])。
并发性与边界条件
由于 operator() 被声明为 const 方法,并且仅作为常量引用以只读方式绑定参数,因此只要所包含类型 T 的底层哈希机制工作时无副作用,该计算大概就能够并发且可重入地执行([SWS_CORE_01199])。 问题 Q-4947f900db7a4494 (未决)
本段文本由 AI 生成,基于 R25-11 规范版本。
| Header-Datei | #include "ara/core/optional.h" |
|---|---|
| Scope | struct std::hash< ara::core::Optional< T > > |
| Exception-Sicherheit | exception safe |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CORE_01199- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CORE_01199@rel:R25-11#ae04d58c- Content hash
ae04d58c- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_01199
Status: valid/unmigrated
Version: rel:R25-11#bfc5a921
Versionshistorie & Revisions (1 transition)
- 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_01199@rel:R25-11#bfc5a921
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 · 德文原文