math: fix align_up declaration

Using add() which is non-constexpr, the align_up() itself may not be
constexpr.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-06-11 09:55:41 +02:00
parent 47d10e2d78
commit b5cc4c01a9

View File

@ -89,7 +89,7 @@ namespace stdex
/// ///
/// \return The first number greater or equal to a that has n lower bits zero /// \return The first number greater or equal to a that has n lower bits zero
/// ///
inline constexpr size_t align_up(size_t a, int n) inline size_t align_up(size_t a, int n)
{ {
const size_t mask = SIZE_MAX << n; const size_t mask = SIZE_MAX << n;
return add(a, ~mask) & mask; return add(a, ~mask) & mask;