MCPcopy Create free account
hub / github.com/codeinred/tuplet / align_value

Function align_value

test/test_alignment.cpp:32–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31template <size_t Alignment, typename T>
32constexpr T align_value(T value) {
33 constexpr auto alignment {static_cast<T>(Alignment)};
34
35 value += alignment - 1;
36 value &= ~(alignment - 1);
37
38 return value;
39}
40
41#if (defined _MSC_VER)
42constexpr bool is_cl_or_clang_cl = true;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected