Skip to main content

types.ixx File

Core type definitions and tag types for the helios engine. More...

Namespaces Index

namespacehelios
namespacecore

Core utilities shared across the helios engine. More...

namespacetypes

Classes Index

structno_init_t

Tag type used to indicate skipping default initialization. More...

Description

Core type definitions and tag types for the helios engine.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file types.ixx
3 * @brief Core type definitions and tag types for the helios engine.
4 */
5module;
6
7
8export module helios.core.types;
9
10
11export namespace helios::core::types {
12
13 /**
14 * @brief Tag type used to indicate skipping default initialization.
15 *
16 * @details `no_init_t` is a tag type that signals to constructors or
17 * factory functions that default initialization should be skipped.
18 * This is useful for performance-critical code paths where objects
19 * will be immediately overwritten or initialized manually.
20 *
21 * ## Usage
22 *
23 * Pass `no_init` as a constructor argument to request uninitialized storage:
24 *
25 * ```cpp
26 * import helios.util.Guid;
27 * import helios.core.types;
28 *
29 * // Generate a new unique Guid
30 * auto id = helios::util::Guid::generate();
31 *
32 * // Declare uninitialized Guid for later assignment
33 * helios::util::Guid deferredId{helios::core::types::no_init};
34 *
35 * // Assign later
36 * deferredId = helios::util::Guid::generate();
37 * ```
38 *
39 * @note Objects constructed with `no_init` are in an indeterminate state.
40 * Reading from them before assignment is undefined behavior.
41 *
42 * @see no_init
43 * @see helios::util::Guid
44 */
45 struct no_init_t{};
46
47 /**
48 * @brief Tag constant for requesting uninitialized construction.
49 *
50 * @details This is a convenience instance of `no_init_t` that can be
51 * passed to constructors supporting uninitialized construction.
52 *
53 * ```cpp
54 * helios::util::Guid id{helios::core::types::no_init};
55 * ```
56 *
57 * @see no_init_t
58 * @see helios::util::Guid
59 */
60 inline constexpr no_init_t no_init;
61
62}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.