diff --git a/benchmark/benchmark_concur.cpp b/benchmark/benchmark_concur.cpp index 046510a..dc38833 100644 --- a/benchmark/benchmark_concur.cpp +++ b/benchmark/benchmark_concur.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "benchmark/benchmark.h" @@ -18,18 +19,18 @@ void concur_queue_rtt(benchmark::State &state) { for (std::int64_t i = 0; !stop.load(std::memory_order_relaxed); ++i) { std::int64_t n {}; while (!que[0].pop(n)) ; - (void)que[1].push(i); + std::ignore = que[1].push(i); } }); for (auto _ : state) { - (void)que[0].push(0); + std::ignore = que[0].push(0); std::int64_t n {}; while (!que[1].pop(n)) ; } stop = true; - (void)que[0].push(0); + std::ignore = que[0].push(0); producer.wait(); } @@ -39,7 +40,7 @@ void concur_queue_1v1(benchmark::State &state) { std::atomic_bool stop = false; auto producer = std::async(std::launch::async, [&stop, &que] { for (std::int64_t i = 0; !stop.load(std::memory_order_relaxed); ++i) { - (void)que.push(i); + std::ignore = que.push(i); std::this_thread::yield(); } }); @@ -65,7 +66,7 @@ void concur_queue_NvN(benchmark::State &state) { prods.resize(state.threads()); auto producer = [] { for (std::int64_t i = 0; run.load(std::memory_order_relaxed) > 0; ++i) { - (void)que.push(i); + std::ignore = que.push(i); std::this_thread::yield(); } }; diff --git a/include/libconcur/data_model.h b/include/libconcur/data_model.h index e6865d4..9805ba8 100644 --- a/include/libconcur/data_model.h +++ b/include/libconcur/data_model.h @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -46,11 +47,11 @@ private: typename decltype(elements)::size_type i = 0; LIBIMP_TRY { for (; i < elements.size(); ++i) { - (void)::LIBIMP::construct>(&elements[i]); + std::ignore = ::LIBIMP::construct>(&elements[i]); } } LIBIMP_CATCH(...) { for (decltype(i) k = 0; k < i; ++k) { - (void)::LIBIMP::destroy>(&elements[k]); + std::ignore = ::LIBIMP::destroy>(&elements[k]); } throw; } @@ -58,7 +59,7 @@ private: ~data() noexcept { for (auto &elem : this->elements()) { - (void)::LIBIMP::destroy>(&elem); + std::ignore = ::LIBIMP::destroy>(&elem); } } @@ -124,7 +125,7 @@ public: ~data_model() noexcept { if (valid()) { auto sz = data_->byte_size(); - (void)::LIBIMP::destroy(data_); + std::ignore = ::LIBIMP::destroy(data_); data_allocator_.deallocate(data_, sz); } }