function hash< ara::core::Optional< T [SWS_CORE_01199]
size_t operator() (ara::core::Optional< T > const &v) const noexcept;
Invoke the hashing function
The specialization struct std::hash<ara::core::Optional<T>> serves to calculate hash values for optional objects of type ara::core::Optional<T> in accordance with [SWS_CORE_01199]. It enables the direct use of ara::core::Optional<T> as a key type in unordered or hash-based standard containers such as std::unordered_map or std::unordered_set.
use
The call is made synchronously via the function call operator operator(), which is declared in header file #include "ara/core/optional.h" ([SWS_CORE_01199]):
- Parameter: The optional object
vis passed as a constant referenceara::core::Optional<T> const &([SWS_CORE_01199]). - Return value: A hash value of type
size_t([SWS_CORE_01199]). - Semantics: The call executes the hash function for the passed instance ([SWS_CORE_01199]).
Error Handling and Exception Safety
The operation is declared as noexcept and is considered exception-safe (exception safe) according to [SWS_CORE_01199]. No specific AUTOSAR error codes or notifications to error hooks (such as DET or DEM) exist, since the calculation is performed failure-free without exceptions ([SWS_CORE_01199]).
Concurrency and Constraints
Since operator() is declared as a const method and binds the argument exclusively in a read-only manner as a constant reference, the calculation is likely executable concurrently and reentrantly, provided that the underlying hash mechanism for the contained type T operates without side effects ([SWS_CORE_01199]). Question Q-4947f900db7a4494 (open)
This text was created by an AI and is based on the R25-11 specification status.
| 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#bfc5a921- Content hash
bfc5a921- 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 · German original