diff options
author | 2019-06-17 22:18:29 +0000 | |
---|---|---|
committer | 2019-06-17 22:18:29 +0000 | |
commit | 504b10ec5101b237e4c07e1f2de4b6c48138181e (patch) | |
tree | 979c9ce8ab11efd05e4413305758dc5d6bc76ab4 /lib/libcxx/include/optional | |
parent | A bit more KNF no binary change (diff) | |
download | wireguard-openbsd-504b10ec5101b237e4c07e1f2de4b6c48138181e.tar.xz wireguard-openbsd-504b10ec5101b237e4c07e1f2de4b6c48138181e.zip |
Import libc++ 8.0.0.
Diffstat (limited to 'lib/libcxx/include/optional')
-rw-r--r-- | lib/libcxx/include/optional | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libcxx/include/optional b/lib/libcxx/include/optional index a76f8d18976..70422068e28 100644 --- a/lib/libcxx/include/optional +++ b/lib/libcxx/include/optional @@ -105,8 +105,8 @@ namespace std { // 23.6.3.3, assignment optional &operator=(nullopt_t) noexcept; - optional &operator=(const optional &); - optional &operator=(optional &&) noexcept(see below ); + optional &operator=(const optional &); // constexpr in C++20 + optional &operator=(optional &&) noexcept(see below); // constexpr in C++20 template <class U = T> optional &operator=(U &&); template <class U> optional &operator=(const optional<U> &); template <class U> optional &operator=(optional<U> &&); @@ -156,6 +156,7 @@ template<class T> #include <stdexcept> #include <type_traits> #include <utility> +#include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -168,7 +169,7 @@ _LIBCPP_PUSH_MACROS namespace std // purposefully not using versioning namespace { -class _LIBCPP_EXCEPTION_ABI bad_optional_access +class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access : public exception { public: @@ -185,6 +186,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS void __throw_bad_optional_access() { #ifndef _LIBCPP_NO_EXCEPTIONS throw bad_optional_access(); @@ -932,6 +934,7 @@ public: using __base::__get; _LIBCPP_INLINE_VISIBILITY + _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr value_type const& value() const& { if (!this->has_value()) @@ -940,6 +943,7 @@ public: } _LIBCPP_INLINE_VISIBILITY + _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr value_type& value() & { if (!this->has_value()) @@ -948,6 +952,7 @@ public: } _LIBCPP_INLINE_VISIBILITY + _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr value_type&& value() && { if (!this->has_value()) @@ -956,6 +961,7 @@ public: } _LIBCPP_INLINE_VISIBILITY + _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS constexpr value_type const&& value() const&& { if (!this->has_value()) |