Skip to content

Commit 2ed79de

Browse files
authored
[orc-rt] Add [[nodiscard]] attributes to Math.h functions. NFC. (#157077)
1 parent c3bb00d commit 2ed79de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

orc-rt/include/orc-rt/Math.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
namespace orc_rt {
2020

2121
/// Test whether the given value is a power of 2.
22-
template <typename T> constexpr bool isPowerOf2(T Val) noexcept {
22+
template <typename T> [[nodiscard]] constexpr bool isPowerOf2(T Val) noexcept {
2323
return Val != 0 && (Val & (Val - 1)) == 0;
2424
}
2525

2626
/// Calculates the next power of 2.
27-
template <typename T> constexpr T nextPowerOf2(T Val) noexcept {
27+
template <typename T> [[nodiscard]] constexpr T nextPowerOf2(T Val) noexcept {
2828
for (std::size_t I = 1; I < std::numeric_limits<T>::digits; I <<= 1)
2929
Val |= (Val >> I);
3030
return Val + 1;

0 commit comments

Comments
 (0)