mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Add alignment utility
This commit is contained in:
parent
fef646fded
commit
c52d129db1
12
src/Utils/Utils/Alignment.h
Normal file
12
src/Utils/Utils/Alignment.h
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user