DEENESPTFRRUARHIKOZHNL

struct ara::core::in_place_t

[SWS_CORE_04011] Upstream: RS_AP_00130

struct in_place_t {...};

Denote an operation to be performed in-place. An instance of this type can be passed to certain constructors of ara::core::Optional to denote the intention that construction of the contained type shall be done in-place, i.e. without any copying taking place.

Header-Datei#include "ara/core/utility.h"
Forwarding-Header#include "ara/core/core_fwd.h"
Scopenamespace ara::core

User GuideAI-GENERATED

Serves as a tag type to indicate in-place constructions in containers such as Optional without copy operations.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 011b812476bc Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as a tag type to indicate in-place constructions in containers such as Optional without copy operations.

The struct ara::core::in_place_t serves as a tag type to designate operations where objects are to be constructed directly in place without copy operations [SWS_CORE_04012]. An instance is typically passed to constructors of wrapper classes such as ara::core::Optional to forward the arguments directly to the constructor of the contained type. Creation occurs via an explicit default constructor defined as exception-safe and noexcept [SWS_CORE_04012]. Because the type is stateless, no error scenarios or complex lifecycle phases exist.

Context

The struct ara::core::in_place_t is a tag type within the module core of the AUTOSAR Adaptive Platform and is provided via the header file #include "ara/core/utility.h" [SWS_CORE_04012]. In modern C++ interfaces, such a tag type serves as a semantic control element for overloads during object creation. The primary role of ara::core::in_place_t is to explicitly declare operations as in-place constructions. An instance of this type is passed to specialized constructors of wrapper classes such as ara::core::Optional to signal the unambiguous intention that the object held in the container is to be constructed directly in place.

This mechanism eliminates the need to create a temporary object outside the container that would subsequently have to be transferred into the container via a copy or move constructor. The class thus acts as an intermediary between the calling application code and the initialization routines of enclosing types, making it particularly important for resource management and efficiency in the context of safety-critical applications.

Lifecycle

The lifecycle of ara::core::in_place_t is designed minimally. The class declares an explicit default constructor explicit in_place_t() noexcept = default; marked as noexcept [SWS_CORE_04012]. As a stateless tag struct, the type has no member variables or dynamic resources. Interpretation: The struct serves exclusively as a type marker for overload resolution by the compiler and does not encapsulate runtime data. Question Q-2fd481aaddfdfbf3 (open) Accordingly, neither complex states nor transitions between different life phases exist.

Instances of ara::core::in_place_t are usually created directly at the call site as temporary values and immediately passed to the target method. No ownership of managed resources arises, and no cleanup work is required upon destruction of the object. Since the type is completely immutable and stateless, instantiation and destruction are inherently concurrency-safe and can be used safely across multiple threads without synchronization mechanisms.

Usage Path

The typical usage path of ara::core::in_place_t focuses on the direct forwarding of construction arguments to wrappers such as ara::core::Optional. First, the application includes the required header file #include "ara/core/utility.h" [SWS_CORE_04012]. When declaring or initializing an ara::core::Optional object, the developer passes an instance of ara::core::in_place_t as the first argument to the constructor. The subsequent arguments correspond exactly to the parameter list of the constructor of the type to be held in the Optional.

By evaluating the tag, the container constructor internally invokes the appropriate constructor of the payload object directly in internal storage. This prevents unnecessary copy and move operations, which is particularly advantageous for types that incur expensive copy operations or whose copy constructor is deleted. After the successful invocation of the target constructor, the purpose of the tag is fully accomplished, and the temporary tag instance is destroyed automatically.

Error Scenarios

Regarding error scenarios and exception safety, ara::core::in_place_t behaves completely error-free. According to the specification, the default constructor is declared as noexcept and has the classification exception safe [SWS_CORE_04012]. No preconditions exist for calling the default constructor, and neither error codes nor C++ exceptions are thrown.

If an error occurs during an in-place construction, the cause does not lie in ara::core::in_place_t, but exclusively in the constructor of the enclosed payload type. If its constructor throws exceptions or reports error states upon invalid parameters, the defined error handling mechanisms of the enclosing container or target type take effect. For in_place_t itself, no postconditions or cleanup work are required in the event of an error.

This class guide is based on the AUTOSAR Adaptive specifications for the core module and was curated automatically.

UML class diagram

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__core__in_place_t356 «struct» in_place_t + in_place_t()

Constructors and destructor

in_place_t function

Default constructor

explicit in_place_t () noexcept=default;

Method documentation

function in_place_t [SWS_CORE_04012] Upstream: RS_AP_00130

explicit in_place_t () noexcept=default;

Default constructor

Header-Datei#include "ara/core/utility.h"
Scopestruct ara::core::in_place_t
Exception-Sicherheitexception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CORE_04012
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_04012@rel:R25-11#77f3b995
Content hash
77f3b995
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_04012
Status: valid/unmigrated Version: rel:R25-11#60e4f564 Versionshistorie & Revisions (1 transition, 8 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_04012@rel:R25-11#60e4f564
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#77f3b9952026-09-30
  • R19-11rel:R19-11#63f31e082026-10-14
  • R20-11rel:R20-11#388fe03d2026-10-14
  • R21-11rel:R21-11#388fe03d2026-10-14
  • R22-11rel:R22-11#5a0e98052026-10-14
  • R23-11rel:R23-11#b9ae75262026-10-14
  • R24-11rel:R24-11#5501994f2026-10-14
  • R25-11rel:R25-11#60e4f5642026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill