Skip to content

ludus::foundation::core

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp

Aliases

nullptr_t

using ludus::foundation::core::nullptr_t = decltype(nullptr)
nullptr_t: the Ludus-scoped spelling of the null pointer literal's type.

Declared in modules/foundation/base/include/ludus/foundation/base/core.h

uint8

using ludus::foundation::core::uint8 = std::uint8_t
Exact 8-bit unsigned integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

uint16

using ludus::foundation::core::uint16 = std::uint16_t
Exact 16-bit unsigned integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

uint32

using ludus::foundation::core::uint32 = std::uint32_t
Exact 32-bit unsigned integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

uint64

using ludus::foundation::core::uint64 = std::uint64_t
Exact 64-bit unsigned integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

int8

using ludus::foundation::core::int8 = std::int8_t
Exact 8-bit signed integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

int16

using ludus::foundation::core::int16 = std::int16_t
Exact 16-bit signed integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

int32

using ludus::foundation::core::int32 = std::int32_t
Exact 32-bit signed integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

int64

using ludus::foundation::core::int64 = std::int64_t
Exact 64-bit signed integer for explicit-width values.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

usize

using ludus::foundation::core::usize = std::size_t
Native unsigned size/index type; matches sizeof and container sizes, not a wire format.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

isize

using ludus::foundation::core::isize = std::ptrdiff_t
Native signed pointer-difference type; width follows the target ABI.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

float32

using ludus::foundation::core::float32 = float
IEEE binary32 scalar; does not select rounding, trap or denormal policy.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

float64

using ludus::foundation::core::float64 = double
IEEE binary64 scalar; does not select rounding, trap or denormal policy.

Declared in modules/foundation/base/include/ludus/foundation/base/types.h

Constants and variables

IsTriviallyRelocatable

template <typename ElementType>
constexpr bool ludus::foundation::core::IsTriviallyRelocatable = IsTriviallyRelocatableTrait<ElementType>::value
True when containers may relocate ElementType by copying bytes and skipping destruction of the source.
Defaults to trivially copyable; extend only with LUDUS_TRIVIALLY_RELOCATABLE.

Declared in modules/foundation/containers/include/ludus/foundation/containers/relocation.hpp

Functions

TryReadLittleEndian

template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryReadLittleEndian(std::span< const uint8 > bytes, ValueType &out) noexcept
Read the first sizeof(ValueType) bytes as a little-endian unsigned integer. Unaligned input is supported; false preserves out when input is too short.

Related types: uint8

Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp

TryReadBigEndian

template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryReadBigEndian(std::span< const uint8 > bytes, ValueType &out) noexcept
Read the first sizeof(ValueType) bytes as a big-endian unsigned integer. Unaligned input is supported; false preserves out when input is too short.

Related types: uint8

Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp

TryWriteLittleEndian

template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryWriteLittleEndian(ValueType value, std::span< uint8 > bytes) noexcept
Write a little-endian unsigned integer into the first sizeof(ValueType) bytes. Unaligned output is supported; trailing bytes stay untouched. Short buffers return false without modifying any bytes.

Related types: uint8

Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp

TryWriteBigEndian

template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryWriteBigEndian(ValueType value, std::span< uint8 > bytes) noexcept
Write a big-endian unsigned integer into the first sizeof(ValueType) bytes. Unaligned output is supported; trailing bytes stay untouched. Short buffers return false without modifying any bytes.

Related types: uint8

Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp

TryIntegerCast

template <Integer DestinationType, Integer SourceType>
constexpr bool ludus::foundation::core::TryIntegerCast(SourceType value, DestinationType &outValue) noexcept
Convert an integer only when its value fits the destination range.

Returns

True on success; false preserves outValue. Output may alias the input. Bool, characters, enums, floats and qualified outputs are excluded; aliases cannot distinguish int32 from native int.

Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp

TryAdd

template <Integer ValueType>
constexpr bool ludus::foundation::core::TryAdd(ValueType left, ValueType right, ValueType &outValue) noexcept
Add without wrapping or saturation; false preserves outValue, including aliased operands.

Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp

TrySubtract

template <Integer ValueType>
constexpr bool ludus::foundation::core::TrySubtract(ValueType left, ValueType right, ValueType &outValue) noexcept
Subtract without wrapping or saturation; false preserves outValue, including aliased operands.

Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp

TryMultiply

template <Integer ValueType>
constexpr bool ludus::foundation::core::TryMultiply(ValueType left, ValueType right, ValueType &outValue) noexcept
Multiply without wrapping or saturation; false preserves outValue, including aliased operands.

Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp

Move

template <typename ValueType>
constexpr std::remove_reference_t< ValueType > && ludus::foundation::core::Move(ValueType &&value) noexcept
Move: unconditional cast to an rvalue reference.
The Ludus-named, verb-first spelling of std::move; call sites read as engine vocabulary and never import the std name. Free and constexpr.

Declared in modules/foundation/base/include/ludus/foundation/base/core.h

Forward

template <typename ValueType>
constexpr ValueType && ludus::foundation::core::Forward(std::remove_reference_t< ValueType > &value) noexcept
Forward: perfect-forward a value while preserving its value category.
The two overloads mirror std::forward's contract (the rvalue overload must not be asked to forward as an lvalue).

Declared in modules/foundation/base/include/ludus/foundation/base/core.h

Forward

template <typename ValueType>
constexpr ValueType && ludus::foundation::core::Forward(std::remove_reference_t< ValueType > &&value) noexcept
Preserve an rvalue's category when forwarding; ValueType must not be an lvalue reference.

Declared in modules/foundation/base/include/ludus/foundation/base/core.h

Swap

template <typename ElementType>
void ludus::foundation::core::Swap(Array< ElementType > &a, Array< ElementType > &b) noexcept
Non-member Swap for ADL.

Related types: Array

Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp

Swap

template <typename KeyType, typename ValueType, typename Compare>
void ludus::foundation::core::Swap(SortedMap< KeyType, ValueType, Compare > &left, SortedMap< KeyType, ValueType, Compare > &right) noexcept
ADL swap: exchanges storage without allocating.

Related types: SortedMap

Declared in modules/foundation/containers/include/ludus/foundation/containers/sorted_map.hpp

Swap

template <typename ElementType, usize Count>
constexpr void ludus::foundation::core::Swap(StaticArray< ElementType, Count > &a, StaticArray< ElementType, Count > &b)
Non-member Swap for ADL.

Related types: StaticArray

Declared in modules/foundation/containers/include/ludus/foundation/containers/static_array.hpp

StaticArray

template <typename First, typename... Rest>
ludus::foundation::core::StaticArray(First, Rest...) -> StaticArray< First, 1+sizeof...(Rest)>
Deduce StaticArray{a, b, c} as StaticArray<decltype(a), 3>; every initializer must convert to the first's type.

Declared in modules/foundation/containers/include/ludus/foundation/containers/static_array.hpp