37 template <
typename T_Type =
void>
54 template <UST t_alignment,
typename T_Type>
55 [[nodiscard]]
inline auto is_aligned(
const volatile T_Type* pointer) noexcept -> bool;
94 template <
typename T_Type>
95 [[nodiscard]]
inline auto is_aligned(
const volatile T_Type* pointer, UST alignment) noexcept -> bool;
111 template <UST t_alignment,
typename T_Type>
112 [[nodiscard]]
inline auto misalignment(
const volatile T_Type* pointer) noexcept ->
UST;
150 template <
typename T_Type>
151 [[nodiscard]]
inline auto misalignment(
const volatile T_Type* pointer, UST alignment) noexcept ->
UST;
168 template <
typename T_Type>
180 template <
typename T_Type>
184 return reinterpret_cast<T_Type*
>(integer);
190 template <UST t_alignment,
typename T_Type>
191 [[nodiscard]]
inline auto is_aligned(
const volatile T_Type* pointer) noexcept ->
bool
194 return misalignment<t_alignment>(pointer) == 0;
200 template <
typename T_Type>
201 [[nodiscard]]
inline auto is_aligned(
const volatile T_Type* pointer,
UST alignment) noexcept ->
bool
210 template <UST t_alignment,
typename T_Type>
211 [[nodiscard]]
inline auto misalignment(
const volatile T_Type* pointer) noexcept ->
UST
219 template <
typename T_Type>
220 [[nodiscard]]
inline auto misalignment(
const volatile T_Type* pointer,
UST alignment) noexcept ->
UST
228 template <
typename T_Type>
233 return reinterpret_cast<UPT>(pointer);
Defines the fundamental data types.
std::uintptr_t UPT
Unsigned integer type that has the same size as a pointer.
Definition: fundamental_types.h:30
std::size_t UST
Unsigned integer type that is returned by sizeof operations.
Definition: fundamental_types.h:29
auto pointer_to_integer(const volatile T_Type *pointer) noexcept -> UPT
Turn a pointer into an integer.
Definition: pointer_operations.h:229
auto misalignment(const volatile T_Type *pointer, UST alignment) noexcept -> UST
Calculate the misalignment of a pointer.
Definition: pointer_operations.h:220
auto is_aligned(const volatile T_Type *pointer, UST alignment) noexcept -> bool
Check if a passed pointer is aligned.
Definition: pointer_operations.h:201
auto integer_to_pointer(UPT integer) noexcept -> T_Type *
Turn an integer into a pointer of the chosen type.
Definition: pointer_operations.h:181