diff options
Diffstat (limited to 'include/future')
-rw-r--r-- | include/future | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/future b/include/future index ce15eafbf7e4..936060e173b8 100644 --- a/include/future +++ b/include/future @@ -322,7 +322,7 @@ template <class R, class... ArgTypes> class packaged_task<R(ArgTypes...)> { public: - typedef R result_type; + typedef R result_type; // extension // construction and destruction packaged_task() noexcept; @@ -1482,6 +1482,7 @@ template <class _Rp> void promise<_Rp>::set_exception(exception_ptr __p) { + _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" ); if (__state_ == nullptr) __throw_future_error(future_errc::no_state); __state_->set_exception(__p); @@ -1513,6 +1514,7 @@ template <class _Rp> void promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p) { + _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" ); if (__state_ == nullptr) __throw_future_error(future_errc::no_state); __state_->set_exception_at_thread_exit(__p); @@ -1629,6 +1631,7 @@ template <class _Rp> void promise<_Rp&>::set_exception(exception_ptr __p) { + _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" ); if (__state_ == nullptr) __throw_future_error(future_errc::no_state); __state_->set_exception(__p); @@ -1647,6 +1650,7 @@ template <class _Rp> void promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p) { + _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" ); if (__state_ == nullptr) __throw_future_error(future_errc::no_state); __state_->set_exception_at_thread_exit(__p); @@ -1994,7 +1998,7 @@ template<class _Rp, class ..._ArgTypes> class _LIBCPP_TYPE_VIS_ONLY packaged_task<_Rp(_ArgTypes...)> { public: - typedef _Rp result_type; + typedef _Rp result_type; // extension private: __packaged_task_function<result_type(_ArgTypes...)> __f_; @@ -2123,7 +2127,7 @@ template<class ..._ArgTypes> class _LIBCPP_TYPE_VIS_ONLY packaged_task<void(_ArgTypes...)> { public: - typedef void result_type; + typedef void result_type; // extension private: __packaged_task_function<result_type(_ArgTypes...)> __f_; |