muu/apply_alignment.h file

Contains the definition of muu::apply_alignment().

Namespaces

namespace muu
The root namespace for all muu functions and types.

Functions

template <size_t Alignment, typename T>
auto apply_alignment(T val) -> T constexpr noexcept
Rounds an unsigned value up to the next multiple of the given alignment.
template <size_t Alignment, typename T>
auto apply_alignment(T* ptr) -> T* constexpr noexcept
Rounds a pointer up to the byte offset that is the next multiple of the given alignment.
template <typename T>
auto apply_alignment(T val, size_t alignment) -> T constexpr noexcept
Rounds an unsigned value up to the next multiple of the given alignment.
template <typename T>
auto apply_alignment(T* ptr, size_t alignment) -> T* constexpr noexcept
Rounds a pointer up to the byte offset that is the next multiple of the given alignment.