Browse Source

common/alignment: Fix compilation errors (#4303)

pull/15/merge
Tobias 6 years ago
committed by GitHub
parent
commit
80a0f2a118
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/common/alignment.h

4
src/common/alignment.h

@ -11,7 +11,9 @@ namespace Common {
template <typename T>
constexpr T AlignUp(T value, std::size_t size) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
return static_cast<T>(value + (size - value % size) % size);
auto mod{static_cast<T>(value % size)};
value -= mod;
return static_cast<T>(mod == T{0} ? value : value + size);
}
template <typename T>

Loading…
Cancel
Save