Functions | |
template<typename T , int size> | |
std::enable_if< size==1, T >::type | nextPower2 (T x) |
template<typename T , int size> | |
std::enable_if< size!=1, T >::type | nextPower2 (T x) |
Efficiently computes the next power of 2 without branching. See "Hacker's Delight" 2nd Edition, by Henry S. Warren, Fig. 3.3. | |
|
inline |