nextPowerOfTwo

Round to next power of 2

nothrow
T
nextPowerOfTwo
(
T
)
(
T k
)

Examples

assert(nextPowerOfTwo(0) == 1);
assert(nextPowerOfTwo(5) == 8);

Meta