From 172ee82f136e6cb8a521968f11a9d1fe137b2ebc Mon Sep 17 00:00:00 2001 From: aurianer Date: Thu, 30 Jan 2020 10:40:10 +0100 Subject: [PATCH] Change the dummy_false_type to sizeof(Future) == 0 In order to avoid an additional call --- hpx/lcos/future.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hpx/lcos/future.hpp b/hpx/lcos/future.hpp index 139b77a55711..03a9e3c7ec47 100644 --- a/hpx/lcos/future.hpp +++ b/hpx/lcos/future.hpp @@ -408,12 +408,6 @@ namespace hpx { namespace lcos { namespace detail make_continuation_alloc_nounwrap(Allocator const& a, Future const& future, Policy&& policy, F&& f); - // Dummy struct to call static assert with a false type - template - struct dummy_false_type : std::false_type - { - }; - /////////////////////////////////////////////////////////////////////////// template struct future_then_dispatch @@ -425,7 +419,7 @@ namespace hpx { namespace lcos { namespace detail call(Future&& fut, F&& f) { // dummy impl to fail compilation if this function is called - static_assert(dummy_false_type::value, "Cannot use the \ + static_assert(sizeof(Future) == 0, "Cannot use the \ dummy implementation of future_then_dispatch, please use \ one of the template specialization."); } @@ -435,7 +429,7 @@ namespace hpx { namespace lcos { namespace detail call(Future && fut, T0 && t, F && f) { // dummy impl to fail compilation if this function is called - static_assert(dummy_false_type::value, "Cannot use the \ + static_assert(sizeof(Future) == 0, "Cannot use the \ dummy implementation of future_then_dispatch, please use \ one of the template specialization."); } @@ -445,7 +439,7 @@ namespace hpx { namespace lcos { namespace detail call_alloc(Allocator const& alloc, Future && fut, F && f) { // dummy impl to fail compilation if this function is called - static_assert(dummy_false_type::value, "Cannot use the \ + static_assert(sizeof(Future) == 0, "Cannot use the \ dummy implementation of future_then_dispatch::call_alloc, \ please use one of the template specialization."); }