aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/future
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/std/future')
-rw-r--r--libstdc++-v3/include/std/future15
1 files changed, 15 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index 6eef686..bdf4a75 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -763,6 +763,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res>
class future : public __basic_future<_Res>
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 3458. Is shared_future intended to work with arrays or function types?
+ static_assert(!is_array<_Res>{}, "result type is not an array");
+ static_assert(!is_function<_Res>{}, "result type is not a function");
+
friend class promise<_Res>;
template<typename> friend class packaged_task;
template<typename _Fn, typename... _Args>
@@ -893,6 +898,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res>
class shared_future : public __basic_future<_Res>
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 3458. Is shared_future intended to work with arrays or function types?
+ static_assert(!is_array<_Res>{}, "result type is not an array");
+ static_assert(!is_function<_Res>{}, "result type is not a function");
+
typedef __basic_future<_Res> _Base_type;
public:
@@ -1045,6 +1055,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Res>
class promise
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 3466: Specify the requirements for promise/future/[...] consistently
+ static_assert(!is_array<_Res>{}, "result type is not an array");
+ static_assert(!is_function<_Res>{}, "result type is not a function");
+
typedef __future_base::_State_base _State;
typedef __future_base::_Result<_Res> _Res_type;
typedef __future_base::_Ptr<_Res_type> _Ptr_type;