Add alignment utility

This commit is contained in:
Jan 2022-03-20 17:38:23 +01:00
parent fef646fded
commit c52d129db1

View File

@ -0,0 +1,12 @@
#pragma once
namespace utils
{
template <typename T>
constexpr T Align(T value, T toNext)
{
if (toNext > 0)
return (value + toNext - 1) / toNext * toNext;
return value;
}
}