mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-10-20 18:42:02 +00:00
Add alignment utility
This commit is contained in:
1 parent
fef646fded
commit
c52d129db1
1 file changed
+12
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user