Skip to content

Commit 5659b2c

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Extirpate FOLLY_NODISCARD in folly/algorithm/simd/detail/UnrollUtils.h +5
Summary: `[[nodiscard]]` is now available in all of our compilers. This diff changes the code to rely on it directly. Generated with ``` reset && xbgs -l FOLLY_NODISCARD | grep -v Portability.h | grep -v json | grep -v xplat | grep -v ThirdParty/ | grep -v third-party | perl -pe 's/^fbsource.//' | xargs -n 100 perl -pe 's/FOLLY_NODISCARD/[[nodiscard]]/' -i ``` Reviewed By: ilvokhin Differential Revision: D87101286 fbshipit-source-id: 0bdd69acfad34c583b15efbe22abbc95096305af
1 parent d09dbf2 commit 5659b2c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

folly/algorithm/simd/detail/UnrollUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct UnrollUtils {
4242
* return an array of results.
4343
*/
4444
template <typename T, std::size_t N, typename Op>
45-
FOLLY_NODISCARD FOLLY_ALWAYS_INLINE static constexpr auto arrayMap(
45+
[[nodiscard]] FOLLY_ALWAYS_INLINE static constexpr auto arrayMap(
4646
const std::array<T, N>& x, Op op) {
4747
return arrayMapImpl(x, op, std::make_index_sequence<N>());
4848
}
@@ -56,7 +56,7 @@ struct UnrollUtils {
5656
* (a + b) + (c + d)
5757
*/
5858
template <typename T, std::size_t N, typename Op>
59-
FOLLY_NODISCARD FOLLY_ALWAYS_INLINE static constexpr T arrayReduce(
59+
[[nodiscard]] FOLLY_ALWAYS_INLINE static constexpr T arrayReduce(
6060
const std::array<T, N>& x, Op op) {
6161
return arrayReduceImpl<0, N>(x, op);
6262
}

folly/concurrency/CacheLocality.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ class CoreAllocator : private std::allocator<T> {
474474
};
475475
};
476476

477-
class FOLLY_NODISCARD CoreAllocatorGuard {
477+
class [[nodiscard]] CoreAllocatorGuard {
478478
public:
479479
CoreAllocatorGuard(size_t numStripes, size_t stripe);
480480
~CoreAllocatorGuard();

folly/coro/AsyncGenerator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ template <
211211
typename Reference,
212212
typename Value = remove_cvref_t<Reference>,
213213
bool RequiresCleanup = false>
214-
class FOLLY_NODISCARD AsyncGenerator {
214+
class [[nodiscard]] AsyncGenerator {
215215
static_assert(
216216
std::is_constructible<Value, Reference>::value,
217217
"AsyncGenerator 'value_type' must be constructible from a 'reference'.");
@@ -253,7 +253,7 @@ class FOLLY_NODISCARD AsyncGenerator {
253253

254254
class CleanupSemiAwaitable;
255255

256-
class FOLLY_NODISCARD CleanupAwaitable {
256+
class [[nodiscard]] CleanupAwaitable {
257257
public:
258258
bool await_ready() noexcept { return !scopeExit_; }
259259

@@ -292,7 +292,7 @@ class FOLLY_NODISCARD AsyncGenerator {
292292
folly::Executor::KeepAlive<> executor_;
293293
};
294294

295-
class FOLLY_NODISCARD CleanupSemiAwaitable {
295+
class [[nodiscard]] CleanupSemiAwaitable {
296296
public:
297297
CleanupAwaitable viaIfAsync(Executor::KeepAlive<> executor) noexcept {
298298
return CleanupAwaitable{scopeExit_, std::move(executor)};

folly/coro/Noexcept.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ using as_noexcept_with_executor_base = TaskWithExecutorWrapperCrtp<
214214
} // namespace detail
215215

216216
template <typename Inner, auto CancelCfg = OnCancel<void>{}>
217-
class FOLLY_NODISCARD as_noexcept_with_executor final
217+
class [[nodiscard]] as_noexcept_with_executor final
218218
: public detail::as_noexcept_with_executor_base<Inner, CancelCfg> {
219219
protected:
220220
using detail::as_noexcept_with_executor_base<Inner, CancelCfg>::

folly/coro/SharedLock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace coro {
3636
namespace detail {
3737

3838
template <typename Mutex, typename Policy>
39-
class FOLLY_NODISCARD LockBase {
39+
class [[nodiscard]] LockBase {
4040
public:
4141
static_assert(std::is_same_v<
4242
bool,

0 commit comments

Comments
 (0)