29 inline bool is_aligned(
const void *ptr,
size_t alignment)
noexcept {
30 auto iptr =
reinterpret_cast<std::uintptr_t
>(ptr);
31 return !(
iptr % alignment);
namespace for basic c++ utilities
bool is_aligned(const void *ptr, size_t alignment) noexcept
Check if a pointer is aligned with the given alignment.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.