From 7e0c47224698f62b3409602fa7cd8946e9626ba7 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Wed, 26 Aug 2020 10:38:11 +0200 Subject: [PATCH] Add HPX_NODISCARD to enable_user_polling structs Avoid mistakes where user polling is enabled and disabled immediately, instead of at the end of a scope. --- libs/async_cuda/include/hpx/async_cuda/cuda_future.hpp | 2 +- libs/async_mpi/include/hpx/async_mpi/mpi_future.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/async_cuda/include/hpx/async_cuda/cuda_future.hpp index c90a2cb8034c..be5d1fd3fb6f 100644 --- a/libs/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -309,7 +309,7 @@ namespace hpx { namespace cuda { namespace experimental { // ----------------------------------------------------------------- // This RAII helper class enables polling for a scoped block - struct enable_user_polling + struct HPX_NODISCARD enable_user_polling { enable_user_polling(std::string const& pool_name = "") : pool_name_(pool_name) diff --git a/libs/async_mpi/include/hpx/async_mpi/mpi_future.hpp b/libs/async_mpi/include/hpx/async_mpi/mpi_future.hpp index b672c7bc1445..dec3c68c9ce0 100644 --- a/libs/async_mpi/include/hpx/async_mpi/mpi_future.hpp +++ b/libs/async_mpi/include/hpx/async_mpi/mpi_future.hpp @@ -230,7 +230,7 @@ namespace hpx { namespace mpi { namespace experimental { // ----------------------------------------------------------------- // This RAII helper class assumes that MPI initialization/finalization is // handled elsewhere - struct enable_user_polling + struct HPX_NODISCARD enable_user_polling { enable_user_polling(std::string const& pool_name = "") : pool_name_(pool_name)