ProgramMax / max

max is a tool belt for C++
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Clean CountZeros. Anticipate consteval #167

Closed ProgramMax closed 3 years ago

ProgramMax commented 3 years ago

consteval from C++20 allows a compile-time only evaluation, unlike constexpr which may or may not be compile-time. Several functions from CountZeros are intended to be invoked only at compile-time.

This commit anticipates consteval support, updating these functions.

Additionally, rename functions away from Constexpr to CompileTime to better reflect this.

ProgramMax commented 3 years ago

This also adds MAX_ASSUME() for the CountTrailingZeroes() functions to hint to the compiler that the values will be in range and won't underflow. Additionally, it updates the 64-bit CountTrailingZeroes() to satisfy the Visual Studio linter that there will not be an overflow.