We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3bb00d commit 2ed79deCopy full SHA for 2ed79de
orc-rt/include/orc-rt/Math.h
@@ -19,12 +19,12 @@
19
namespace orc_rt {
20
21
/// Test whether the given value is a power of 2.
22
-template <typename T> constexpr bool isPowerOf2(T Val) noexcept {
+template <typename T> [[nodiscard]] constexpr bool isPowerOf2(T Val) noexcept {
23
return Val != 0 && (Val & (Val - 1)) == 0;
24
}
25
26
/// Calculates the next power of 2.
27
-template <typename T> constexpr T nextPowerOf2(T Val) noexcept {
+template <typename T> [[nodiscard]] constexpr T nextPowerOf2(T Val) noexcept {
28
for (std::size_t I = 1; I < std::numeric_limits<T>::digits; I <<= 1)
29
Val |= (Val >> I);
30
return Val + 1;
0 commit comments