@@ -241,7 +241,7 @@ template <class T>
241241struct n_least_significant_bits_fn {
242242 static_assert (detail::supported_in_bits_operations_v<T>);
243243
244- FOLLY_NODISCARD constexpr T operator ()(std::uint32_t n) const {
244+ [[nodiscard]] constexpr T operator ()(std::uint32_t n) const {
245245 if (!folly::is_constant_evaluated_or (true )) {
246246 compiler_may_unsafely_assume (n <= sizeof (T) * 8 );
247247
@@ -272,7 +272,7 @@ template <class T>
272272struct n_most_significant_bits_fn {
273273 static_assert (detail::supported_in_bits_operations_v<T>);
274274
275- FOLLY_NODISCARD constexpr T operator ()(std::uint32_t n) const {
275+ [[nodiscard]] constexpr T operator ()(std::uint32_t n) const {
276276 if (!folly::is_constant_evaluated_or (true )) {
277277 compiler_may_unsafely_assume (n <= sizeof (T) * 8 );
278278
@@ -303,7 +303,7 @@ inline constexpr n_most_significant_bits_fn<T> n_most_significant_bits;
303303// / Clears n least significant (right) bits. Other bits stay the same.
304304struct clear_n_least_significant_bits_fn {
305305 template <typename T>
306- FOLLY_NODISCARD constexpr T operator ()(T x, std::uint32_t n) const {
306+ [[nodiscard]] constexpr T operator ()(T x, std::uint32_t n) const {
307307 static_assert (detail::supported_in_bits_operations_v<T>);
308308
309309 // alternative is to do two shifts but that has
@@ -321,7 +321,7 @@ inline constexpr clear_n_least_significant_bits_fn
321321// / Sets n least significant (right) bits. Other bits stay the same.
322322struct set_n_least_significant_bits_fn {
323323 template <typename T>
324- FOLLY_NODISCARD constexpr T operator ()(T x, std::uint32_t n) const {
324+ [[nodiscard]] constexpr T operator ()(T x, std::uint32_t n) const {
325325 static_assert (detail::supported_in_bits_operations_v<T>);
326326
327327 // alternative is to do two shifts but that has
@@ -338,7 +338,7 @@ inline constexpr set_n_least_significant_bits_fn set_n_least_significant_bits;
338338// / Clears n most significant (left) bits. Other bits stay the same.
339339struct clear_n_most_significant_bits_fn {
340340 template <typename T>
341- FOLLY_NODISCARD constexpr T operator ()(T x, std::uint32_t n) const {
341+ [[nodiscard]] constexpr T operator ()(T x, std::uint32_t n) const {
342342 static_assert (detail::supported_in_bits_operations_v<T>);
343343
344344 if (!folly::is_constant_evaluated_or (true )) {
@@ -366,7 +366,7 @@ inline constexpr clear_n_most_significant_bits_fn clear_n_most_significant_bits;
366366// / Sets n most significant (left) bits. Other bits stay the same.
367367struct set_n_most_significant_bits_fn {
368368 template <typename T>
369- FOLLY_NODISCARD constexpr T operator ()(T x, std::uint32_t n) const {
369+ [[nodiscard]] constexpr T operator ()(T x, std::uint32_t n) const {
370370 static_assert (detail::supported_in_bits_operations_v<T>);
371371 return x | n_most_significant_bits<T>(n);
372372 }
@@ -485,7 +485,7 @@ class Endian {
485485// /
486486struct get_bit_at_fn {
487487 template <typename Uint>
488- FOLLY_NODISCARD constexpr bool operator ()(
488+ [[nodiscard]] constexpr bool operator ()(
489489 const Uint* ptr, std::size_t idx) const noexcept {
490490 static_assert (std::is_unsigned_v<std::remove_cv_t <Uint>>);
491491 static_assert (!std::is_same_v<std::remove_cv_t <Uint>, bool >);
0 commit comments