|
Celeritas 0.7+e2c8f84
|
#include <cstddef>#include <functional>#include <type_traits>#include "Assert.hh"#include "Macros.hh"#include "Types.hh"#include <ostream>Classes | |
| class | celeritas::OpaqueId< ItemT, SizeT > |
| Type-safe index for accessing an array or collection of data. More... | |
| struct | celeritas::LdgTraits< OpaqueId< I, T >, void > |
Macros | |
| #define | CELER_DEFINE_OPAQUEID_CMP(TOKEN) |
| #define | CELER_DEFINE_OPAQUEID_CMP(TOKEN) |
Functions | |
| template<class IdT , class U > | |
| auto | celeritas::id_cast (U value) noexcept(! 0) -> std::enable_if_t< is_opaque_id_v< IdT > &&std::is_integral_v< U >, IdT > |
| Safely create an OpaqueId from an integer of any type. | |
| template<class V , class S > | |
| std::ostream & | celeritas::operator<< (std::ostream &os, OpaqueId< V, S > const &v) |
| Output an opaque ID's value or a placeholder if unavailable. | |
Variables | |
| template<class T > | |
| constexpr T | celeritas::nullid_value {static_cast<T>(-1)} |
| Sentinel value for an unassigned opaque ID. | |
| template<class T > | |
| constexpr bool | celeritas::is_opaque_id_v = detail::IsOpaqueId<T>::value |
| True if T is an OpaqueID. | |
| #define CELER_DEFINE_OPAQUEID_CMP | ( | TOKEN | ) |
| #define CELER_DEFINE_OPAQUEID_CMP | ( | TOKEN | ) |
|
inlinenoexcept |
Safely create an OpaqueId from an integer of any type.
This asserts that the integer is in the valid range of the target ID type, and casts to it.
static_cast<FooId>(FooId{}.unchecked_get()) will not work.