aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/future
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/future')
-rw-r--r--contrib/llvm-project/libcxx/include/future60
1 files changed, 18 insertions, 42 deletions
diff --git a/contrib/llvm-project/libcxx/include/future b/contrib/llvm-project/libcxx/include/future
index e35eedf35641..f4a5b43eef08 100644
--- a/contrib/llvm-project/libcxx/include/future
+++ b/contrib/llvm-project/libcxx/include/future
@@ -361,14 +361,16 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
*/
+#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
+#include <__chrono/duration.h>
+#include <__chrono/time_point.h>
#include <__config>
-#include <__debug>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
#include <__utility/auto_cast.h>
#include <__utility/forward.h>
-#include <chrono>
+#include <__utility/move.h>
#include <exception>
#include <memory>
#include <mutex>
@@ -376,13 +378,17 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
#include <thread>
#include <version>
+#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+# include <chrono>
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
+# pragma GCC system_header
#endif
#ifdef _LIBCPP_HAS_NO_THREADS
-#error <future> is not supported on this single threaded system
-#else // !_LIBCPP_HAS_NO_THREADS
+# error "<future> is not supported since libc++ has been configured without support for threads."
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -399,7 +405,7 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc> : public true_type {};
-#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
+#ifdef _LIBCPP_CXX03_LANG
template <>
struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
#endif
@@ -413,7 +419,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(launch)
};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)
-#ifndef _LIBCPP_HAS_NO_STRONG_ENUMS
+#ifndef _LIBCPP_CXX03_LANG
typedef underlying_type<launch>::type __launch_underlying_type;
@@ -473,7 +479,7 @@ operator^=(launch& __x, launch __y)
__x = __x ^ __y; return __x;
}
-#endif // !_LIBCPP_HAS_NO_STRONG_ENUMS
+#endif // !_LIBCPP_CXX03_LANG
//enum class future_status
_LIBCPP_DECLARE_STRONG_ENUM(future_status)
@@ -1885,25 +1891,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
packaged_task() _NOEXCEPT : __p_(nullptr) {}
template <class _Fp,
- class = typename enable_if
- <
- !is_same<
- typename __uncvref<_Fp>::type,
- packaged_task
- >::value
- >::type
- >
+ class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
template <class _Fp, class _Allocator,
- class = typename enable_if
- <
- !is_same<
- typename __uncvref<_Fp>::type,
- packaged_task
- >::value
- >::type
- >
+ class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
@@ -2014,25 +2006,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
packaged_task() _NOEXCEPT : __p_(nullptr) {}
template <class _Fp,
- class = typename enable_if
- <
- !is_same<
- typename __uncvref<_Fp>::type,
- packaged_task
- >::value
- >::type
- >
+ class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
template <class _Fp, class _Allocator,
- class = typename enable_if
- <
- !is_same<
- typename __uncvref<_Fp>::type,
- packaged_task
- >::value
- >::type
- >
+ class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
_LIBCPP_INLINE_VISIBILITY
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
@@ -2458,6 +2436,4 @@ future<void>::share() _NOEXCEPT
_LIBCPP_END_NAMESPACE_STD
-#endif // !_LIBCPP_HAS_NO_THREADS
-
#endif // _LIBCPP_FUTURE