stellarlib 0.1.0
Loading...
Searching...
No Matches
stellarlib::ext Namespace Reference

Standard library extensions. More...

Namespaces

namespace  filesystem
 Standard library extensions.

Classes

class  vector_allocator
 Linear memory allocator optimized for vectors. More...
class  arena
 Fixed-size, page-aligned memory arena. More...
class  arena_allocator
 Dynamic arena allocator. More...
struct  padding
 Compile-time padding for explicit field layout alignment. More...

Typedefs

template<typename Pack, typename T>
using expand_as = T
 Expands a parameter pack into a repeated type.
template<typename T>
using is_trivially_relocatable = std::bool_constant<std::is_trivially_move_constructible_v<T> && std::is_trivially_destructible_v<T>>
 Evaluates whether T is eligible for bit-wise relocation.

Functions

template<typename T>
constexpr auto bit_index (const T arg) noexcept
 Calculates the segment index of a bit in an array.
template<typename T>
constexpr auto bit_mask (const T arg) noexcept
 Calculates the segment mask of a bit in an array.
template<typename Scope, typename SizeType = std::size_t>
constexpr auto sequential_id () noexcept
 Thread-safe sequential ID generator scoped by type.
template<typename Scope, typename T, typename SizeType = std::size_t>
constexpr auto scoped_typeid () noexcept
 Generates a unique ID per type within a scope.

Variables

template<typename T>
constexpr bool is_trivially_relocatable_v {is_trivially_relocatable<T>::value}
 Evaluates whether T is eligible for bit-wise relocation.

Detailed Description

Standard library extensions.

Typedef Documentation

◆ expand_as

template<typename Pack, typename T>
using stellarlib::ext::expand_as = T

Expands a parameter pack into a repeated type.

Template Parameters
PackParameter pack used to drive expansion
TType to substitute for each element

◆ is_trivially_relocatable

template<typename T>
using stellarlib::ext::is_trivially_relocatable = std::bool_constant<std::is_trivially_move_constructible_v<T> && std::is_trivially_destructible_v<T>>

Evaluates whether T is eligible for bit-wise relocation.

Template Parameters
TType to evaluate

Function Documentation

◆ bit_index()

template<typename T>
auto stellarlib::ext::bit_index ( const T arg)
nodiscardconstexprnoexcept

Calculates the segment index of a bit in an array.

Template Parameters
TUnsigned integral type of the segment
Parameters
argIndex of the bit
Returns
Segment index of the bit in the array

◆ bit_mask()

template<typename T>
auto stellarlib::ext::bit_mask ( const T arg)
nodiscardconstexprnoexcept

Calculates the segment mask of a bit in an array.

Template Parameters
TUnsigned integral type of the segment
Parameters
argIndex of the bit
Returns
Segment mask of the bit in the array

◆ sequential_id()

template<typename Scope, typename SizeType = std::size_t>
auto stellarlib::ext::sequential_id ( )
nodiscardconstexprnoexcept

Thread-safe sequential ID generator scoped by type.

Template Parameters
ScopeDistinct type used to separate ID sequences
SizeTypeIntegral type of the ID
Returns
Next ID in the sequence for the given scope

◆ scoped_typeid()

template<typename Scope, typename T, typename SizeType = std::size_t>
auto stellarlib::ext::scoped_typeid ( )
nodiscardconstexprnoexcept

Generates a unique ID per type within a scope.

Template Parameters
ScopeDistinct type used to separate ID spaces
TType to retrieve an ID for
SizeTypeIntegral type of the ID
Returns
Unique ID corresponding to type T within the scope

Variable Documentation

◆ is_trivially_relocatable_v

template<typename T>
bool stellarlib::ext::is_trivially_relocatable_v {is_trivially_relocatable<T>::value}
constexpr

Evaluates whether T is eligible for bit-wise relocation.

Template Parameters
TType to evaluate