From 5fe4108e7c23778023ddcedb57ecef839e91b264 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 1 Sep 2022 11:56:29 +0300 Subject: [PATCH 1/4] new future message --- stl/inc/yvals_core.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index e418abc221c..669db318873 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -603,9 +603,10 @@ "the temporary 'std::future' is destroyed, waiting for an async result or evaluating " \ "a deferred result, thus defeating the purpose of 'std::async'.") -#define _NODISCARD_GET_FUTURE \ - _NODISCARD_MSG("Getting the future more than once or not satisfying the obtained future will throw a " \ - "future_error exception, so it is incorrect to call 'get_future' and discard the return value.") +#define _NODISCARD_GET_FUTURE \ + _NODISCARD_MSG("It is likely to be incorrect to call 'get_future' and discard the return value, as it will miss " \ + "the only chance yo get the shared state. (Getting the future more than once will throw a " \ + "future_error exception).") #pragma push_macro("msvc") #pragma push_macro("known_semantics") From a313040f84c9a19100923e0d80925f9414012f84 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 1 Sep 2022 12:38:57 +0300 Subject: [PATCH 2/4] Update stl/inc/yvals_core.h Co-authored-by: Jovibor --- stl/inc/yvals_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 669db318873..6a698500398 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -604,8 +604,8 @@ "a deferred result, thus defeating the purpose of 'std::async'.") #define _NODISCARD_GET_FUTURE \ - _NODISCARD_MSG("It is likely to be incorrect to call 'get_future' and discard the return value, as it will miss " \ - "the only chance yo get the shared state. (Getting the future more than once will throw a " \ + _NODISCARD_MSG("It is most likely incorrect to call 'get_future' and discard the return value, as it will miss " \ + "the only chance to get the shared state. (Getting the future more than once will throw a " \ "future_error exception).") #pragma push_macro("msvc") From f3a2606f8e61f6d201042c087e8c004fa50649ea Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 1 Sep 2022 12:37:40 +0300 Subject: [PATCH 3/4] formatting --- stl/inc/yvals_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 6a698500398..d105485fcab 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -603,9 +603,9 @@ "the temporary 'std::future' is destroyed, waiting for an async result or evaluating " \ "a deferred result, thus defeating the purpose of 'std::async'.") -#define _NODISCARD_GET_FUTURE \ +#define _NODISCARD_GET_FUTURE \ _NODISCARD_MSG("It is most likely incorrect to call 'get_future' and discard the return value, as it will miss " \ - "the only chance to get the shared state. (Getting the future more than once will throw a " \ + "the only chance to get the shared state. (Getting the future more than once will throw a " \ "future_error exception).") #pragma push_macro("msvc") From 8ae5c7a95bd5189aef6863b951364038d3827efe Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Fri, 2 Sep 2022 08:53:44 +0300 Subject: [PATCH 4/4] as @CaseyCarter and @StephanTLavavej suggested --- stl/inc/yvals_core.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index d105485fcab..2f224c7bf99 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -603,10 +603,8 @@ "the temporary 'std::future' is destroyed, waiting for an async result or evaluating " \ "a deferred result, thus defeating the purpose of 'std::async'.") -#define _NODISCARD_GET_FUTURE \ - _NODISCARD_MSG("It is most likely incorrect to call 'get_future' and discard the return value, as it will miss " \ - "the only chance to get the shared state. (Getting the future more than once will throw a " \ - "future_error exception).") +#define _NODISCARD_GET_FUTURE \ + _NODISCARD_MSG("Since 'get_future' may be called only once, discarding the result is likely a mistake.") #pragma push_macro("msvc") #pragma push_macro("known_semantics")