aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2012-05-03 16:04:02 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2012-05-03 16:04:02 +0000
commit43cd7615798ea22556f20bbd64cff1e0c691e1d0 (patch)
tree856ce4e42da23163e4316bca6732710e898f0265
parentacbeab898d6a7f4036c55962a2460aab3e0eda3f (diff)
downloadsrc-43cd7615798ea22556f20bbd64cff1e0c691e1d0.tar.gz
src-43cd7615798ea22556f20bbd64cff1e0c691e1d0.zip
Import a new version of libc++ into the vendor branch.vendor/libc++/r156067
Notes
Notes: svn path=/vendor/libc++/dist/; revision=234959 svn path=/vendor/libc++/r156067/; revision=234960; tag=vendor/libc++/r156067
-rw-r--r--include/__config4
-rw-r--r--include/__tuple29
-rw-r--r--include/algorithm17
-rw-r--r--include/atomic722
-rw-r--r--include/cmath13
-rw-r--r--include/limits834
-rw-r--r--include/memory60
-rw-r--r--include/random193
-rw-r--r--include/system_error2
-rw-r--r--include/tuple58
-rw-r--r--include/type_traits100
-rw-r--r--include/utility7
-rw-r--r--src/iostream.cpp63
-rw-r--r--src/stdexcept.cpp4
-rw-r--r--src/utility.cpp1
15 files changed, 1071 insertions, 1036 deletions
diff --git a/include/__config b/include/__config
index 6b2901458587..7cd01dc1b55b 100644
--- a/include/__config
+++ b/include/__config
@@ -384,7 +384,9 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
-#define constexpr const
+#define _LIBCPP_CONSTEXPR
+#else
+#define _LIBCPP_CONSTEXPR constexpr
#endif
#ifndef __has_feature
diff --git a/include/__tuple b/include/__tuple
index 3b2be1c5a74d..82168048e6ce 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -216,7 +216,7 @@ struct __tuple_convertible_imp : public false_type {};
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
: public integral_constant<bool,
- is_constructible<_Up0, _Tp0>::value &&
+ is_convertible<_Tp0, _Up0>::value &&
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
template <>
@@ -235,6 +235,33 @@ struct __tuple_convertible<_Tp, _Up, true, true>
typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
{};
+// __tuple_constructible
+
+template <bool, class _Tp, class _Up>
+struct __tuple_constructible_imp : public false_type {};
+
+template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
+struct __tuple_constructible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
+ : public integral_constant<bool,
+ is_constructible<_Up0, _Tp0>::value &&
+ __tuple_constructible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+
+template <>
+struct __tuple_constructible_imp<true, __tuple_types<>, __tuple_types<> >
+ : public true_type {};
+
+template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
+ bool = __tuple_like<_Up>::value>
+struct __tuple_constructible
+ : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_constructible<_Tp, _Up, true, true>
+ : public __tuple_constructible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
+ tuple_size<_Up>::value,
+ typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
+{};
+
// __tuple_assignable
template <bool, class _Tp, class _Up>
diff --git a/include/algorithm b/include/algorithm
index f9c6843a60a7..d924a7de3f2d 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -2508,11 +2508,16 @@ private:
_Engine_result_type __mask0_;
_Engine_result_type __mask1_;
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
- + _Working_result_type(1);
- static const size_t __m = __log2<_Working_result_type, _Rp>::value;
- static const size_t _WDt = numeric_limits<_Working_result_type>::digits;
- static const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+ + _Working_result_type(1);
+#else
+ static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+ + _Working_result_type(1);
+#endif
+ static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+ static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+ static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
public:
// constructors and seeding functions
@@ -2712,8 +2717,8 @@ public:
result_type operator()();
- static constexpr result_type min() {return _Min;}
- static constexpr result_type max() {return _Max;}
+ static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
+ static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
friend __rs_default __rs_get();
};
diff --git a/include/atomic b/include/atomic
index f2e428a2611a..6a200eba599f 100644
--- a/include/atomic
+++ b/include/atomic
@@ -29,7 +29,7 @@ typedef enum memory_order
memory_order_seq_cst // store-release load-acquire
} memory_order;
-template <class T> T kill_dependency(T y);
+template <class T> T kill_dependency(T y) noexcept;
// lock-free property
@@ -46,40 +46,40 @@ template <class T> T kill_dependency(T y);
typedef struct atomic_flag
{
- bool test_and_set(memory_order m = memory_order_seq_cst) volatile;
- bool test_and_set(memory_order m = memory_order_seq_cst);
- void clear(memory_order m = memory_order_seq_cst) volatile;
- void clear(memory_order m = memory_order_seq_cst);
- atomic_flag() = default;
+ bool test_and_set(memory_order m = memory_order_seq_cst) volatile noexcept;
+ bool test_and_set(memory_order m = memory_order_seq_cst) noexcept;
+ void clear(memory_order m = memory_order_seq_cst) volatile noexcept;
+ void clear(memory_order m = memory_order_seq_cst) noexcept;
+ atomic_flag() noexcept = default;
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) volatile = delete;
} atomic_flag;
bool
- atomic_flag_test_and_set(volatile atomic_flag* obj);
+ atomic_flag_test_and_set(volatile atomic_flag* obj) noexcept;
bool
- atomic_flag_test_and_set(atomic_flag* obj);
+ atomic_flag_test_and_set(atomic_flag* obj) noexcept;
bool
atomic_flag_test_and_set_explicit(volatile atomic_flag* obj,
- memory_order m);
+ memory_order m) noexcept;
bool
- atomic_flag_test_and_set_explicit(atomic_flag* obj, memory_order m);
+ atomic_flag_test_and_set_explicit(atomic_flag* obj, memory_order m) noexcept;
void
- atomic_flag_clear(volatile atomic_flag* obj);
+ atomic_flag_clear(volatile atomic_flag* obj) noexcept;
void
- atomic_flag_clear(atomic_flag* obj);
+ atomic_flag_clear(atomic_flag* obj) noexcept;
void
- atomic_flag_clear_explicit(volatile atomic_flag* obj, memory_order m);
+ atomic_flag_clear_explicit(volatile atomic_flag* obj, memory_order m) noexcept;
void
- atomic_flag_clear_explicit(atomic_flag* obj, memory_order m);
+ atomic_flag_clear_explicit(atomic_flag* obj, memory_order m) noexcept;
#define ATOMIC_FLAG_INIT see below
#define ATOMIC_VAR_INIT(value) see below
@@ -87,388 +87,388 @@ void
template <class T>
struct atomic
{
- bool is_lock_free() const volatile;
- bool is_lock_free() const;
- void store(T desr, memory_order m = memory_order_seq_cst) volatile;
- void store(T desr, memory_order m = memory_order_seq_cst);
- T load(memory_order m = memory_order_seq_cst) const volatile;
- T load(memory_order m = memory_order_seq_cst) const;
- operator T() const volatile;
- operator T() const;
- T exchange(T desr, memory_order m = memory_order_seq_cst) volatile;
- T exchange(T desr, memory_order m = memory_order_seq_cst);
+ bool is_lock_free() const volatile noexcept;
+ bool is_lock_free() const noexcept;
+ void store(T desr, memory_order m = memory_order_seq_cst) volatile noexcept;
+ void store(T desr, memory_order m = memory_order_seq_cst) noexcept;
+ T load(memory_order m = memory_order_seq_cst) const volatile noexcept;
+ T load(memory_order m = memory_order_seq_cst) const noexcept;
+ operator T() const volatile noexcept;
+ operator T() const noexcept;
+ T exchange(T desr, memory_order m = memory_order_seq_cst) volatile noexcept;
+ T exchange(T desr, memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_weak(T& expc, T desr,
- memory_order s, memory_order f) volatile;
- bool compare_exchange_weak(T& expc, T desr, memory_order s, memory_order f);
+ memory_order s, memory_order f) volatile noexcept;
+ bool compare_exchange_weak(T& expc, T desr, memory_order s, memory_order f) noexcept;
bool compare_exchange_strong(T& expc, T desr,
- memory_order s, memory_order f) volatile;
+ memory_order s, memory_order f) volatile noexcept;
bool compare_exchange_strong(T& expc, T desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
bool compare_exchange_weak(T& expc, T desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_weak(T& expc, T desr,
- memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_strong(T& expc, T desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_strong(T& expc, T desr,
- memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) noexcept;
- atomic() = default;
- constexpr atomic(T desr);
+ atomic() noexcept = default;
+ constexpr atomic(T desr) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
- T operator=(T) volatile;
- T operator=(T);
+ T operator=(T) volatile noexcept;
+ T operator=(T) noexcept;
};
template <>
struct atomic<integral>
{
- bool is_lock_free() const volatile;
- bool is_lock_free() const;
- void store(integral desr, memory_order m = memory_order_seq_cst) volatile;
- void store(integral desr, memory_order m = memory_order_seq_cst);
- integral load(memory_order m = memory_order_seq_cst) const volatile;
- integral load(memory_order m = memory_order_seq_cst) const;
- operator integral() const volatile;
- operator integral() const;
+ bool is_lock_free() const volatile noexcept;
+ bool is_lock_free() const noexcept;
+ void store(integral desr, memory_order m = memory_order_seq_cst) volatile noexcept;
+ void store(integral desr, memory_order m = memory_order_seq_cst) noexcept;
+ integral load(memory_order m = memory_order_seq_cst) const volatile noexcept;
+ integral load(memory_order m = memory_order_seq_cst) const noexcept;
+ operator integral() const volatile noexcept;
+ operator integral() const noexcept;
integral exchange(integral desr,
- memory_order m = memory_order_seq_cst) volatile;
- integral exchange(integral desr, memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral exchange(integral desr, memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_weak(integral& expc, integral desr,
- memory_order s, memory_order f) volatile;
+ memory_order s, memory_order f) volatile noexcept;
bool compare_exchange_weak(integral& expc, integral desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
bool compare_exchange_strong(integral& expc, integral desr,
- memory_order s, memory_order f) volatile;
+ memory_order s, memory_order f) volatile noexcept;
bool compare_exchange_strong(integral& expc, integral desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
bool compare_exchange_weak(integral& expc, integral desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_weak(integral& expc, integral desr,
- memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_strong(integral& expc, integral desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_strong(integral& expc, integral desr,
- memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) noexcept;
integral
- fetch_add(integral op, memory_order m = memory_order_seq_cst) volatile;
- integral fetch_add(integral op, memory_order m = memory_order_seq_cst);
+ fetch_add(integral op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral fetch_add(integral op, memory_order m = memory_order_seq_cst) noexcept;
integral
- fetch_sub(integral op, memory_order m = memory_order_seq_cst) volatile;
- integral fetch_sub(integral op, memory_order m = memory_order_seq_cst);
+ fetch_sub(integral op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral fetch_sub(integral op, memory_order m = memory_order_seq_cst) noexcept;
integral
- fetch_and(integral op, memory_order m = memory_order_seq_cst) volatile;
- integral fetch_and(integral op, memory_order m = memory_order_seq_cst);
+ fetch_and(integral op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral fetch_and(integral op, memory_order m = memory_order_seq_cst) noexcept;
integral
- fetch_or(integral op, memory_order m = memory_order_seq_cst) volatile;
- integral fetch_or(integral op, memory_order m = memory_order_seq_cst);
+ fetch_or(integral op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral fetch_or(integral op, memory_order m = memory_order_seq_cst) noexcept;
integral
- fetch_xor(integral op, memory_order m = memory_order_seq_cst) volatile;
- integral fetch_xor(integral op, memory_order m = memory_order_seq_cst);
+ fetch_xor(integral op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ integral fetch_xor(integral op, memory_order m = memory_order_seq_cst) noexcept;
- atomic() = default;
- constexpr atomic(integral desr);
+ atomic() noexcept = default;
+ constexpr atomic(integral desr) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
- integral operator=(integral desr) volatile;
- integral operator=(integral desr);
-
- integral operator++(int) volatile;
- integral operator++(int);
- integral operator--(int) volatile;
- integral operator--(int);
- integral operator++() volatile;
- integral operator++();
- integral operator--() volatile;
- integral operator--();
- integral operator+=(integral op) volatile;
- integral operator+=(integral op);
- integral operator-=(integral op) volatile;
- integral operator-=(integral op);
- integral operator&=(integral op) volatile;
- integral operator&=(integral op);
- integral operator|=(integral op) volatile;
- integral operator|=(integral op);
- integral operator^=(integral op) volatile;
- integral operator^=(integral op);
+ integral operator=(integral desr) volatile noexcept;
+ integral operator=(integral desr) noexcept;
+
+ integral operator++(int) volatile noexcept;
+ integral operator++(int) noexcept;
+ integral operator--(int) volatile noexcept;
+ integral operator--(int) noexcept;
+ integral operator++() volatile noexcept;
+ integral operator++() noexcept;
+ integral operator--() volatile noexcept;
+ integral operator--() noexcept;
+ integral operator+=(integral op) volatile noexcept;
+ integral operator+=(integral op) noexcept;
+ integral operator-=(integral op) volatile noexcept;
+ integral operator-=(integral op) noexcept;
+ integral operator&=(integral op) volatile noexcept;
+ integral operator&=(integral op) noexcept;
+ integral operator|=(integral op) volatile noexcept;
+ integral operator|=(integral op) noexcept;
+ integral operator^=(integral op) volatile noexcept;
+ integral operator^=(integral op) noexcept;
};
template <class T>
struct atomic<T*>
{
- bool is_lock_free() const volatile;
- bool is_lock_free() const;
- void store(T* desr, memory_order m = memory_order_seq_cst) volatile;
- void store(T* desr, memory_order m = memory_order_seq_cst);
- T* load(memory_order m = memory_order_seq_cst) const volatile;
- T* load(memory_order m = memory_order_seq_cst) const;
- operator T*() const volatile;
- operator T*() const;
- T* exchange(T* desr, memory_order m = memory_order_seq_cst) volatile;
- T* exchange(T* desr, memory_order m = memory_order_seq_cst);
+ bool is_lock_free() const volatile noexcept;
+ bool is_lock_free() const noexcept;
+ void store(T* desr, memory_order m = memory_order_seq_cst) volatile noexcept;
+ void store(T* desr, memory_order m = memory_order_seq_cst) noexcept;
+ T* load(memory_order m = memory_order_seq_cst) const volatile noexcept;
+ T* load(memory_order m = memory_order_seq_cst) const noexcept;
+ operator T*() const volatile noexcept;
+ operator T*() const noexcept;
+ T* exchange(T* desr, memory_order m = memory_order_seq_cst) volatile noexcept;
+ T* exchange(T* desr, memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_weak(T*& expc, T* desr,
- memory_order s, memory_order f) volatile;
+ memory_order s, memory_order f) volatile noexcept;
bool compare_exchange_weak(T*& expc, T* desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
bool compare_exchange_strong(T*& expc, T* desr,
- memory_order s, memory_order f) volatile;
+ memory_order s, memory_order f) volatile noexcept;
bool compare_exchange_strong(T*& expc, T* desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
bool compare_exchange_weak(T*& expc, T* desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_weak(T*& expc, T* desr,
- memory_order m = memory_order_seq_cst);
+ memory_order m = memory_order_seq_cst) noexcept;
bool compare_exchange_strong(T*& expc, T* desr,
- memory_order m = memory_order_seq_cst) volatile;
+ memory_order m = memory_order_seq_cst) volatile noexcept;
bool compare_exchange_strong(T*& expc, T* desr,
- memory_order m = memory_order_seq_cst);
- T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile;
- T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst);
- T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile;
- T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst);
-
- atomic() = default;
- constexpr atomic(T* desr);
+ memory_order m = memory_order_seq_cst) noexcept;
+ T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst) noexcept;
+ T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile noexcept;
+ T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst) noexcept;
+
+ atomic() noexcept = default;
+ constexpr atomic(T* desr) noexcept;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
- T* operator=(T*) volatile;
- T* operator=(T*);
- T* operator++(int) volatile;
- T* operator++(int);
- T* operator--(int) volatile;
- T* operator--(int);
- T* operator++() volatile;
- T* operator++();
- T* operator--() volatile;
- T* operator--();
- T* operator+=(ptrdiff_t op) volatile;
- T* operator+=(ptrdiff_t op);
- T* operator-=(ptrdiff_t op) volatile;
- T* operator-=(ptrdiff_t op);
+ T* operator=(T*) volatile noexcept;
+ T* operator=(T*) noexcept;
+ T* operator++(int) volatile noexcept;
+ T* operator++(int) noexcept;
+ T* operator--(int) volatile noexcept;
+ T* operator--(int) noexcept;
+ T* operator++() volatile noexcept;
+ T* operator++() noexcept;
+ T* operator--() volatile noexcept;
+ T* operator--() noexcept;
+ T* operator+=(ptrdiff_t op) volatile noexcept;
+ T* operator+=(ptrdiff_t op) noexcept;
+ T* operator-=(ptrdiff_t op) volatile noexcept;
+ T* operator-=(ptrdiff_t op) noexcept;
};
template <class T>
bool
- atomic_is_lock_free(const volatile atomic<T>* obj);
+ atomic_is_lock_free(const volatile atomic<T>* obj) noexcept;
template <class T>
bool
- atomic_is_lock_free(const atomic<T>* obj);
+ atomic_is_lock_free(const atomic<T>* obj) noexcept;
template <class T>
void
- atomic_init(volatile atomic<T>* obj, T desr);
+ atomic_init(volatile atomic<T>* obj, T desr) noexcept;
template <class T>
void
- atomic_init(atomic<T>* obj, T desr);
+ atomic_init(atomic<T>* obj, T desr) noexcept;
template <class T>
void
- atomic_store(volatile atomic<T>* obj, T desr);
+ atomic_store(volatile atomic<T>* obj, T desr) noexcept;
template <class T>
void
- atomic_store(atomic<T>* obj, T desr);
+ atomic_store(atomic<T>* obj, T desr) noexcept;
template <class T>
void
- atomic_store_explicit(volatile atomic<T>* obj, T desr, memory_order m);
+ atomic_store_explicit(volatile atomic<T>* obj, T desr, memory_order m) noexcept;
template <class T>
void
- atomic_store_explicit(atomic<T>* obj, T desr, memory_order m);
+ atomic_store_explicit(atomic<T>* obj, T desr, memory_order m) noexcept;
template <class T>
T
- atomic_load(const volatile atomic<T>* obj);
+ atomic_load(const volatile atomic<T>* obj) noexcept;
template <class T>
T
- atomic_load(const atomic<T>* obj);
+ atomic_load(const atomic<T>* obj) noexcept;
template <class T>
T
- atomic_load_explicit(const volatile atomic<T>* obj, memory_order m);
+ atomic_load_explicit(const volatile atomic<T>* obj, memory_order m) noexcept;
template <class T>
T
- atomic_load_explicit(const atomic<T>* obj, memory_order m);
+ atomic_load_explicit(const atomic<T>* obj, memory_order m) noexcept;
template <class T>
T
- atomic_exchange(volatile atomic<T>* obj, T desr);
+ atomic_exchange(volatile atomic<T>* obj, T desr) noexcept;
template <class T>
T
- atomic_exchange(atomic<T>* obj, T desr);
+ atomic_exchange(atomic<T>* obj, T desr) noexcept;
template <class T>
T
- atomic_exchange_explicit(volatile atomic<T>* obj, T desr, memory_order m);
+ atomic_exchange_explicit(volatile atomic<T>* obj, T desr, memory_order m) noexcept;
template <class T>
T
- atomic_exchange_explicit(atomic<T>* obj, T desr, memory_order m);
+ atomic_exchange_explicit(atomic<T>* obj, T desr, memory_order m) noexcept;
template <class T>
bool
- atomic_compare_exchange_weak(volatile atomic<T>* obj, T* expc, T desr);
+ atomic_compare_exchange_weak(volatile atomic<T>* obj, T* expc, T desr) noexcept;
template <class T>
bool
- atomic_compare_exchange_weak(atomic<T>* obj, T* expc, T desr);
+ atomic_compare_exchange_weak(atomic<T>* obj, T* expc, T desr) noexcept;
template <class T>
bool
- atomic_compare_exchange_strong(volatile atomic<T>* obj, T* expc, T desr);
+ atomic_compare_exchange_strong(volatile atomic<T>* obj, T* expc, T desr) noexcept;
template <class T>
bool
- atomic_compare_exchange_strong(atomic<T>* obj, T* expc, T desr);
+ atomic_compare_exchange_strong(atomic<T>* obj, T* expc, T desr) noexcept;
template <class T>
bool
atomic_compare_exchange_weak_explicit(volatile atomic<T>* obj, T* expc,
T desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
template <class T>
bool
atomic_compare_exchange_weak_explicit(atomic<T>* obj, T* expc, T desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
template <class T>
bool
atomic_compare_exchange_strong_explicit(volatile atomic<T>* obj,
T* expc, T desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
template <class T>
bool
atomic_compare_exchange_strong_explicit(atomic<T>* obj, T* expc,
T desr,
- memory_order s, memory_order f);
+ memory_order s, memory_order f) noexcept;
template <class Integral>
Integral
- atomic_fetch_add(volatile atomic<Integral>* obj, Integral op);
+ atomic_fetch_add(volatile atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
- atomic_fetch_add(atomic<Integral>* obj, Integral op);
+ atomic_fetch_add(atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
atomic_fetch_add_explicit(volatile atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
atomic_fetch_add_explicit(atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
- atomic_fetch_sub(volatile atomic<Integral>* obj, Integral op);
+ atomic_fetch_sub(volatile atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
- atomic_fetch_sub(atomic<Integral>* obj, Integral op);
+ atomic_fetch_sub(atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
atomic_fetch_sub_explicit(volatile atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
atomic_fetch_sub_explicit(atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
- atomic_fetch_and(volatile atomic<Integral>* obj, Integral op);
+ atomic_fetch_and(volatile atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
- atomic_fetch_and(atomic<Integral>* obj, Integral op);
+ atomic_fetch_and(atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
atomic_fetch_and_explicit(volatile atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
atomic_fetch_and_explicit(atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
- atomic_fetch_or(volatile atomic<Integral>* obj, Integral op);
+ atomic_fetch_or(volatile atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
- atomic_fetch_or(atomic<Integral>* obj, Integral op);
+ atomic_fetch_or(atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
atomic_fetch_or_explicit(volatile atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
atomic_fetch_or_explicit(atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
- atomic_fetch_xor(volatile atomic<Integral>* obj, Integral op);
+ atomic_fetch_xor(volatile atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
- atomic_fetch_xor(atomic<Integral>* obj, Integral op);
+ atomic_fetch_xor(atomic<Integral>* obj, Integral op) noexcept;
template <class Integral>
Integral
atomic_fetch_xor_explicit(volatile atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class Integral>
Integral
atomic_fetch_xor_explicit(atomic<Integral>* obj, Integral op,
- memory_order m);
+ memory_order m) noexcept;
template <class T>
T*
- atomic_fetch_add(volatile atomic<T*>* obj, ptrdiff_t op);
+ atomic_fetch_add(volatile atomic<T*>* obj, ptrdiff_t op) noexcept;
template <class T>
T*
- atomic_fetch_add(atomic<T*>* obj, ptrdiff_t op);
+ atomic_fetch_add(atomic<T*>* obj, ptrdiff_t op) noexcept;
template <class T>
T*
atomic_fetch_add_explicit(volatile atomic<T*>* obj, ptrdiff_t op,
- memory_order m);
+ memory_order m) noexcept;
template <class T>
T*
- atomic_fetch_add_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m);
+ atomic_fetch_add_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m) noexcept;
template <class T>
T*
- atomic_fetch_sub(volatile atomic<T*>* obj, ptrdiff_t op);
+ atomic_fetch_sub(volatile atomic<T*>* obj, ptrdiff_t op) noexcept;
template <class T>
T*
- atomic_fetch_sub(atomic<T*>* obj, ptrdiff_t op);
+ atomic_fetch_sub(atomic<T*>* obj, ptrdiff_t op) noexcept;
template <class T>
T*
atomic_fetch_sub_explicit(volatile atomic<T*>* obj, ptrdiff_t op,
- memory_order m);
+ memory_order m) noexcept;
template <class T>
T*
- atomic_fetch_sub_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m);
+ atomic_fetch_sub_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m) noexcept;
// Atomics for standard typedef types
@@ -514,8 +514,8 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
// fences
-void atomic_thread_fence(memory_order m);
-void atomic_signal_fence(memory_order m);
+void atomic_thread_fence(memory_order m) noexcept;
+void atomic_signal_fence(memory_order m) noexcept;
} // std
@@ -545,7 +545,7 @@ typedef enum memory_order
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-kill_dependency(_Tp __y)
+kill_dependency(_Tp __y) _NOEXCEPT
{
return __y;
}
@@ -558,70 +558,70 @@ struct __atomic_base // false
_Atomic(_Tp) __a_;
_LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const volatile
- {return __atomic_is_lock_free(_Tp());}
+ bool is_lock_free() const volatile _NOEXCEPT
+ {return __c11_atomic_is_lock_free(sizeof(_Tp));}
_LIBCPP_INLINE_VISIBILITY
- bool is_lock_free() const
- {return __atomic_is_lock_free(_Tp());}
+ bool is_lock_free() const _NOEXCEPT
+ {return __c11_atomic_is_lock_free(sizeof(_Tp));}
_LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile
- {__atomic_store(&__a_, __d, __m);}
+ void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {__c11_atomic_store(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
- void store(_Tp __d, memory_order __m = memory_order_seq_cst)
- {__atomic_store(&__a_, __d, __m);}
+ void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {__c11_atomic_store(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const volatile
- {return __atomic_load(&__a_, __m);}
+ _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ {return __c11_atomic_load(&__a_, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp load(memory_order __m = memory_order_seq_cst) const
- {return __atomic_load(&__a_, __m);}
+ _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ {return __c11_atomic_load(&__a_, __m);}
_LIBCPP_INLINE_VISIBILITY
- operator _Tp() const volatile {return load();}
+ operator _Tp() const volatile _NOEXCEPT {return load();}
_LIBCPP_INLINE_VISIBILITY
- operator _Tp() const {return load();}
+ operator _Tp() const _NOEXCEPT {return load();}
_LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_exchange(&__a_, __d, __m);}
+ _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_exchange(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst)
- {return __atomic_exchange(&__a_, __d, __m);}
+ _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_exchange(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile
- {return __atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
+ memory_order __s, memory_order __f) volatile _NOEXCEPT
+ {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f)
- {return __atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
+ memory_order __s, memory_order __f) _NOEXCEPT
+ {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f) volatile
- {return __atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
+ memory_order __s, memory_order __f) volatile _NOEXCEPT
+ {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __s, memory_order __f)
- {return __atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
+ memory_order __s, memory_order __f) _NOEXCEPT
+ {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
+ memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst)
- {return __atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
+ memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
+ memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
- memory_order __m = memory_order_seq_cst)
- {return __atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
+ memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
- __atomic_base() {} // = default;
+ __atomic_base() _NOEXCEPT {} // = default;
_LIBCPP_INLINE_VISIBILITY
- /*constexpr*/ __atomic_base(_Tp __d) { __atomic_store(&__a_, __d, memory_order_seq_cst); }
+ _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
__atomic_base(const __atomic_base&) = delete;
__atomic_base& operator=(const __atomic_base&) = delete;
@@ -642,77 +642,77 @@ struct __atomic_base<_Tp, true>
{
typedef __atomic_base<_Tp, false> __base;
_LIBCPP_INLINE_VISIBILITY
- __atomic_base() {} // = default;
+ __atomic_base() _NOEXCEPT {} // = default;
_LIBCPP_INLINE_VISIBILITY
- /*constexpr*/ __atomic_base(_Tp __d) : __base(__d) {}
+ _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_fetch_add(&this->__a_, __op, __m);}
+ _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_add(&this->__a_, __op, __m);}
+ _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_fetch_sub(&this->__a_, __op, __m);}
+ _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_sub(&this->__a_, __op, __m);}
+ _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_fetch_and(&this->__a_, __op, __m);}
+ _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_fetch_and(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_and(&this->__a_, __op, __m);}
+ _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_and(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_fetch_or(&this->__a_, __op, __m);}
+ _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_fetch_or(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_or(&this->__a_, __op, __m);}
+ _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_or(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_fetch_xor(&this->__a_, __op, __m);}
+ _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_xor(&this->__a_, __op, __m);}
+ _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) volatile {return fetch_add(_Tp(1));}
+ _Tp operator++(int) volatile _NOEXCEPT {return fetch_add(_Tp(1));}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator++(int) {return fetch_add(_Tp(1));}
+ _Tp operator++(int) _NOEXCEPT {return fetch_add(_Tp(1));}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) volatile {return fetch_sub(_Tp(1));}
+ _Tp operator--(int) volatile _NOEXCEPT {return fetch_sub(_Tp(1));}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator--(int) {return fetch_sub(_Tp(1));}
+ _Tp operator--(int) _NOEXCEPT {return fetch_sub(_Tp(1));}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator++() volatile {return fetch_add(_Tp(1)) + _Tp(1);}
+ _Tp operator++() volatile _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator++() {return fetch_add(_Tp(1)) + _Tp(1);}
+ _Tp operator++() _NOEXCEPT {return fetch_add(_Tp(1)) + _Tp(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator--() volatile {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _Tp operator--() volatile _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator--() {return fetch_sub(_Tp(1)) - _Tp(1);}
+ _Tp operator--() _NOEXCEPT {return fetch_sub(_Tp(1)) - _Tp(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) volatile {return fetch_add(__op) + __op;}
+ _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator+=(_Tp __op) {return fetch_add(__op) + __op;}
+ _Tp operator+=(_Tp __op) _NOEXCEPT {return fetch_add(__op) + __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) volatile {return fetch_sub(__op) - __op;}
+ _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator-=(_Tp __op) {return fetch_sub(__op) - __op;}
+ _Tp operator-=(_Tp __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) volatile {return fetch_and(__op) & __op;}
+ _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator&=(_Tp __op) {return fetch_and(__op) & __op;}
+ _Tp operator&=(_Tp __op) _NOEXCEPT {return fetch_and(__op) & __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) volatile {return fetch_or(__op) | __op;}
+ _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator|=(_Tp __op) {return fetch_or(__op) | __op;}
+ _Tp operator|=(_Tp __op) _NOEXCEPT {return fetch_or(__op) | __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) volatile {return fetch_xor(__op) ^ __op;}
+ _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator^=(_Tp __op) {return fetch_xor(__op) ^ __op;}
+ _Tp operator^=(_Tp __op) _NOEXCEPT {return fetch_xor(__op) ^ __op;}
};
// atomic<T>
@@ -723,15 +723,15 @@ struct atomic
{
typedef __atomic_base<_Tp> __base;
_LIBCPP_INLINE_VISIBILITY
- atomic() {} // = default;
+ atomic() _NOEXCEPT {} // = default;
_LIBCPP_INLINE_VISIBILITY
- /*constexpr*/ atomic(_Tp __d) : __base(__d) {}
+ _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d) volatile
+ _Tp operator=(_Tp __d) volatile _NOEXCEPT
{__base::store(__d); return __d;}
_LIBCPP_INLINE_VISIBILITY
- _Tp operator=(_Tp __d)
+ _Tp operator=(_Tp __d) _NOEXCEPT
{__base::store(__d); return __d;}
};
@@ -743,56 +743,56 @@ struct atomic<_Tp*>
{
typedef __atomic_base<_Tp*> __base;
_LIBCPP_INLINE_VISIBILITY
- atomic() {} // = default;
+ atomic() _NOEXCEPT {} // = default;
_LIBCPP_INLINE_VISIBILITY
- /*constexpr*/ atomic(_Tp* __d) : __base(__d) {}
+ _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d) volatile
+ _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
{__base::store(__d); return __d;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator=(_Tp* __d)
+ _Tp* operator=(_Tp* __d) _NOEXCEPT
{__base::store(__d); return __d;}
_LIBCPP_INLINE_VISIBILITY
_Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
- volatile
- {return __atomic_fetch_add(&this->__a_, __op, __m);}
+ volatile _NOEXCEPT
+ {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_add(&this->__a_, __op, __m);}
+ _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
_Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
- volatile
- {return __atomic_fetch_sub(&this->__a_, __op, __m);}
+ volatile _NOEXCEPT
+ {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
- {return __atomic_fetch_sub(&this->__a_, __op, __m);}
+ _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) volatile {return fetch_add(1);}
+ _Tp* operator++(int) volatile _NOEXCEPT {return fetch_add(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator++(int) {return fetch_add(1);}
+ _Tp* operator++(int) _NOEXCEPT {return fetch_add(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) volatile {return fetch_sub(1);}
+ _Tp* operator--(int) volatile _NOEXCEPT {return fetch_sub(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator--(int) {return fetch_sub(1);}
+ _Tp* operator--(int) _NOEXCEPT {return fetch_sub(1);}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() volatile {return fetch_add(1) + 1;}
+ _Tp* operator++() volatile _NOEXCEPT {return fetch_add(1) + 1;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator++() {return fetch_add(1) + 1;}
+ _Tp* operator++() _NOEXCEPT {return fetch_add(1) + 1;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() volatile {return fetch_sub(1) - 1;}
+ _Tp* operator--() volatile _NOEXCEPT {return fetch_sub(1) - 1;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator--() {return fetch_sub(1) - 1;}
+ _Tp* operator--() _NOEXCEPT {return fetch_sub(1) - 1;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) volatile {return fetch_add(__op) + __op;}
+ _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator+=(ptrdiff_t __op) {return fetch_add(__op) + __op;}
+ _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT {return fetch_add(__op) + __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) volatile {return fetch_sub(__op) - __op;}
+ _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
_LIBCPP_INLINE_VISIBILITY
- _Tp* operator-=(ptrdiff_t __op) {return fetch_sub(__op) - __op;}
+ _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT {return fetch_sub(__op) - __op;}
};
// atomic_is_lock_free
@@ -800,7 +800,7 @@ struct atomic<_Tp*>
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_is_lock_free(const volatile atomic<_Tp>* __o)
+atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
{
return __o->is_lock_free();
}
@@ -808,7 +808,7 @@ atomic_is_lock_free(const volatile atomic<_Tp>* __o)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_is_lock_free(const atomic<_Tp>* __o)
+atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
{
return __o->is_lock_free();
}
@@ -818,17 +818,17 @@ atomic_is_lock_free(const atomic<_Tp>* __o)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_init(volatile atomic<_Tp>* __o, _Tp __d)
+atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
- __atomic_store(&__o->__a_, __d, memory_order_seq_cst);
+ __c11_atomic_init(&__o->__a_, __d);
}
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_init(atomic<_Tp>* __o, _Tp __d)
+atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
- __atomic_store(&__o->__a_, __d, memory_order_seq_cst);
+ __c11_atomic_init(&__o->__a_, __d);
}
// atomic_store
@@ -836,7 +836,7 @@ atomic_init(atomic<_Tp>* __o, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_store(volatile atomic<_Tp>* __o, _Tp __d)
+atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
__o->store(__d);
}
@@ -844,7 +844,7 @@ atomic_store(volatile atomic<_Tp>* __o, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_store(atomic<_Tp>* __o, _Tp __d)
+atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
__o->store(__d);
}
@@ -854,7 +854,7 @@ atomic_store(atomic<_Tp>* __o, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m)
+atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
__o->store(__d, __m);
}
@@ -862,7 +862,7 @@ atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m)
+atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
__o->store(__d, __m);
}
@@ -872,7 +872,7 @@ atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_load(const volatile atomic<_Tp>* __o)
+atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
{
return __o->load();
}
@@ -880,7 +880,7 @@ atomic_load(const volatile atomic<_Tp>* __o)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_load(const atomic<_Tp>* __o)
+atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
{
return __o->load();
}
@@ -890,7 +890,7 @@ atomic_load(const atomic<_Tp>* __o)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m)
+atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
{
return __o->load(__m);
}
@@ -898,7 +898,7 @@ atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m)
+atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
{
return __o->load(__m);
}
@@ -908,7 +908,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d)
+atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
return __o->exchange(__d);
}
@@ -916,7 +916,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange(atomic<_Tp>* __o, _Tp __d)
+atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
return __o->exchange(__d);
}
@@ -926,7 +926,7 @@ atomic_exchange(atomic<_Tp>* __o, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m)
+atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
return __o->exchange(__d, __m);
}
@@ -934,7 +934,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
-atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m)
+atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
return __o->exchange(__d, __m);
}
@@ -944,7 +944,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d)
+atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d);
}
@@ -952,7 +952,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d)
+atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d);
}
@@ -962,7 +962,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d)
+atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d);
}
@@ -970,7 +970,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d)
+atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d);
}
@@ -982,7 +982,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
_Tp __d,
- memory_order __s, memory_order __f)
+ memory_order __s, memory_order __f) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d, __s, __f);
}
@@ -991,7 +991,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d,
- memory_order __s, memory_order __f)
+ memory_order __s, memory_order __f) _NOEXCEPT
{
return __o->compare_exchange_weak(*__e, __d, __s, __f);
}
@@ -1003,7 +1003,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
_Tp* __e, _Tp __d,
- memory_order __s, memory_order __f)
+ memory_order __s, memory_order __f) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d, __s, __f);
}
@@ -1013,7 +1013,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,
_Tp __d,
- memory_order __s, memory_order __f)
+ memory_order __s, memory_order __f) _NOEXCEPT
{
return __o->compare_exchange_strong(*__e, __d, __s, __f);
}
@@ -1027,7 +1027,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
@@ -1039,7 +1039,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_add(atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
@@ -1047,7 +1047,7 @@ atomic_fetch_add(atomic<_Tp>* __o, _Tp __op)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op)
+atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
@@ -1055,7 +1055,7 @@ atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op)
+atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
{
return __o->fetch_add(__op);
}
@@ -1069,7 +1069,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
@@ -1081,7 +1081,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
@@ -1090,7 +1090,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
- memory_order __m)
+ memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
@@ -1098,7 +1098,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m)
+atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_add(__op, __m);
}
@@ -1112,7 +1112,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
@@ -1124,7 +1124,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
@@ -1132,7 +1132,7 @@ atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op)
+atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
@@ -1140,7 +1140,7 @@ atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op)
+atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
{
return __o->fetch_sub(__op);
}
@@ -1154,7 +1154,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
@@ -1166,7 +1166,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
@@ -1175,7 +1175,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
- memory_order __m)
+ memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
@@ -1183,7 +1183,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
-atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m)
+atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_sub(__op, __m);
}
@@ -1197,7 +1197,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_and(__op);
}
@@ -1209,7 +1209,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and(atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_and(__op);
}
@@ -1223,7 +1223,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_and(__op, __m);
}
@@ -1235,7 +1235,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_and(__op, __m);
}
@@ -1249,7 +1249,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_or(__op);
}
@@ -1261,7 +1261,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or(atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_or(__op);
}
@@ -1275,7 +1275,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_or(__op, __m);
}
@@ -1287,7 +1287,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_or(__op, __m);
}
@@ -1301,7 +1301,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_xor(__op);
}
@@ -1313,7 +1313,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op)
+atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
return __o->fetch_xor(__op);
}
@@ -1327,7 +1327,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_xor(__op, __m);
}
@@ -1339,7 +1339,7 @@ typename enable_if
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
_Tp
>::type
-atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
+atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
return __o->fetch_xor(__op, __m);
}
@@ -1351,22 +1351,22 @@ typedef struct atomic_flag
_Atomic(bool) __a_;
_LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst) volatile
- {return __atomic_exchange(&__a_, true, __m);}
+ bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {return __c11_atomic_exchange(&__a_, true, __m);}
_LIBCPP_INLINE_VISIBILITY
- bool test_and_set(memory_order __m = memory_order_seq_cst)
- {return __atomic_exchange(&__a_, true, __m);}
+ bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {return __c11_atomic_exchange(&__a_, true, __m);}
_LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst) volatile
- {__atomic_store(&__a_, false, __m);}
+ void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ {__c11_atomic_store(&__a_, false, __m);}
_LIBCPP_INLINE_VISIBILITY
- void clear(memory_order __m = memory_order_seq_cst)
- {__atomic_store(&__a_, false, __m);}
+ void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ {__c11_atomic_store(&__a_, false, __m);}
_LIBCPP_INLINE_VISIBILITY
- atomic_flag() {} // = default;
+ atomic_flag() _NOEXCEPT {} // = default;
_LIBCPP_INLINE_VISIBILITY
- atomic_flag(bool __b) { __atomic_store(&__a_, __b, memory_order_seq_cst); }
+ atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {}
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
atomic_flag(const atomic_flag&) = delete;
@@ -1382,56 +1382,56 @@ private:
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_flag_test_and_set(volatile atomic_flag* __o)
+atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
{
return __o->test_and_set();
}
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_flag_test_and_set(atomic_flag* __o)
+atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
{
return __o->test_and_set();
}
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m)
+atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
{
return __o->test_and_set(__m);
}
inline _LIBCPP_INLINE_VISIBILITY
bool
-atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m)
+atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
{
return __o->test_and_set(__m);
}
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_flag_clear(volatile atomic_flag* __o)
+atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
{
__o->clear();
}
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_flag_clear(atomic_flag* __o)
+atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
{
__o->clear();
}
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m)
+atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
{
__o->clear(__m);
}
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m)
+atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
{
__o->clear(__m);
}
@@ -1440,16 +1440,16 @@ atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m)
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_thread_fence(memory_order __m)
+atomic_thread_fence(memory_order __m) _NOEXCEPT
{
- __atomic_thread_fence(__m);
+ __c11_atomic_thread_fence(__m);
}
inline _LIBCPP_INLINE_VISIBILITY
void
-atomic_signal_fence(memory_order __m)
+atomic_signal_fence(memory_order __m) _NOEXCEPT
{
- __atomic_signal_fence(__m);
+ __c11_atomic_signal_fence(__m);
}
// Atomics for standard typedef types
diff --git a/include/cmath b/include/cmath
index 026889f81e5b..76d7a821acb1 100644
--- a/include/cmath
+++ b/include/cmath
@@ -648,10 +648,17 @@ using ::double_t;
// abs
-template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if<is_floating_point<_A1>::value, _A1>::type
-abs(_A1 __x) {return fabs(__x);}
+float
+abs(float __x) {return fabsf(__x);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+double
+abs(double __x) {return fabs(__x);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+long double
+abs(long double __x) {return fabsl(__x);}
#ifndef __sun__
diff --git a/include/limits b/include/limits
index ea579ad31361..68e63366abec 100644
--- a/include/limits
+++ b/include/limits
@@ -21,43 +21,43 @@ template<class T>
class numeric_limits
{
public:
- static const bool is_specialized = false;
- static T min() noexcept;
- static T max() noexcept;
- static T lowest() noexcept;
-
- static const int digits = 0;
- static const int digits10 = 0;
- static const int max_digits10 = 0;
- static const bool is_signed = false;
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const int radix = 0;
- static T epsilon() noexcept;
- static T round_error() noexcept;
-
- static const int min_exponent = 0;
- static const int min_exponent10 = 0;
- static const int max_exponent = 0;
- static const int max_exponent10 = 0;
-
- static const bool has_infinity = false;
- static const bool has_quiet_NaN = false;
- static const bool has_signaling_NaN = false;
- static const float_denorm_style has_denorm = denorm_absent;
- static const bool has_denorm_loss = false;
- static T infinity() noexcept;
- static T quiet_NaN() noexcept;
- static T signaling_NaN() noexcept;
- static T denorm_min() noexcept;
-
- static const bool is_iec559 = false;
- static const bool is_bounded = false;
- static const bool is_modulo = false;
-
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_toward_zero;
+ static constexpr bool is_specialized = false;
+ static constexpr T min() noexcept;
+ static constexpr T max() noexcept;
+ static constexpr T lowest() noexcept;
+
+ static constexpr int digits = 0;
+ static constexpr int digits10 = 0;
+ static constexpr int max_digits10 = 0;
+ static constexpr bool is_signed = false;
+ static constexpr bool is_integer = false;
+ static constexpr bool is_exact = false;
+ static constexpr int radix = 0;
+ static constexpr T epsilon() noexcept;
+ static constexpr T round_error() noexcept;
+
+ static constexpr int min_exponent = 0;
+ static constexpr int min_exponent10 = 0;
+ static constexpr int max_exponent = 0;
+ static constexpr int max_exponent10 = 0;
+
+ static constexpr bool has_infinity = false;
+ static constexpr bool has_quiet_NaN = false;
+ static constexpr bool has_signaling_NaN = false;
+ static constexpr float_denorm_style has_denorm = denorm_absent;
+ static constexpr bool has_denorm_loss = false;
+ static constexpr T infinity() noexcept;
+ static constexpr T quiet_NaN() noexcept;
+ static constexpr T signaling_NaN() noexcept;
+ static constexpr T denorm_min() noexcept;
+
+ static constexpr bool is_iec559 = false;
+ static constexpr bool is_bounded = false;
+ static constexpr bool is_modulo = false;
+
+ static constexpr bool traps = false;
+ static constexpr bool tinyness_before = false;
+ static constexpr float_round_style round_style = round_toward_zero;
};
enum float_round_style
@@ -139,55 +139,55 @@ class __libcpp_numeric_limits
protected:
typedef _Tp type;
- static const bool is_specialized = false;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return type();}
-
- static const int digits = 0;
- static const int digits10 = 0;
- static const int max_digits10 = 0;
- static const bool is_signed = false;
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const int radix = 0;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type();}
-
- static const int min_exponent = 0;
- static const int min_exponent10 = 0;
- static const int max_exponent = 0;
- static const int max_exponent10 = 0;
-
- static const bool has_infinity = false;
- static const bool has_quiet_NaN = false;
- static const bool has_signaling_NaN = false;
- static const float_denorm_style has_denorm = denorm_absent;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type();}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type();}
-
- static const bool is_iec559 = false;
- static const bool is_bounded = false;
- static const bool is_modulo = false;
-
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_toward_zero;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return type();}
+
+ static _LIBCPP_CONSTEXPR const int digits = 0;
+ static _LIBCPP_CONSTEXPR const int digits10 = 0;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 0;
+ static _LIBCPP_CONSTEXPR const bool is_signed = false;
+ static _LIBCPP_CONSTEXPR const bool is_integer = false;
+ static _LIBCPP_CONSTEXPR const bool is_exact = false;
+ static _LIBCPP_CONSTEXPR const int radix = 0;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type();}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = 0;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = false;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type();}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = false;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = false;
+
+ static _LIBCPP_CONSTEXPR const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
template <class _Tp, int digits, bool is_signed>
struct __libcpp_compute_min
{
- static const _Tp value = _Tp(_Tp(1) << digits);
+ static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits);
};
template <class _Tp, int digits>
struct __libcpp_compute_min<_Tp, digits, false>
{
- static const _Tp value = _Tp(0);
+ static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0);
};
template <class _Tp>
@@ -196,50 +196,50 @@ class __libcpp_numeric_limits<_Tp, true>
protected:
typedef _Tp type;
- static const bool is_specialized = true;
-
- static const bool is_signed = type(-1) < type(0);
- static const int digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed);
- static const int digits10 = digits * 3 / 10;
- static const int max_digits10 = 0;
- static const type __min = __libcpp_compute_min<type, digits, is_signed>::value;
- static const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
-
- static const bool is_integer = true;
- static const bool is_exact = true;
- static const int radix = 2;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
-
- static const int min_exponent = 0;
- static const int min_exponent10 = 0;
- static const int max_exponent = 0;
- static const int max_exponent10 = 0;
-
- static const bool has_infinity = false;
- static const bool has_quiet_NaN = false;
- static const bool has_signaling_NaN = false;
- static const float_denorm_style has_denorm = denorm_absent;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
-
- static const bool is_iec559 = false;
- static const bool is_bounded = true;
- static const bool is_modulo = true;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = true;
+
+ static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0);
+ static _LIBCPP_CONSTEXPR const int digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed);
+ static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 0;
+ static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value;
+ static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0);
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_integer = true;
+ static _LIBCPP_CONSTEXPR const bool is_exact = true;
+ static _LIBCPP_CONSTEXPR const int radix = 2;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = 0;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = false;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = true;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = true;
#if __i386__ || __x86_64__
- static const bool traps = true;
+ static _LIBCPP_CONSTEXPR const bool traps = true;
#else
- static const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool traps = false;
#endif
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_toward_zero;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
template <>
@@ -248,46 +248,46 @@ class __libcpp_numeric_limits<bool, true>
protected:
typedef bool type;
- static const bool is_specialized = true;
-
- static const bool is_signed = false;
- static const int digits = 1;
- static const int digits10 = 0;
- static const int max_digits10 = 0;
- static const type __min = false;
- static const type __max = true;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __min;}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __max;}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return min();}
-
- static const bool is_integer = true;
- static const bool is_exact = true;
- static const int radix = 2;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return type(0);}
-
- static const int min_exponent = 0;
- static const int min_exponent10 = 0;
- static const int max_exponent = 0;
- static const int max_exponent10 = 0;
-
- static const bool has_infinity = false;
- static const bool has_quiet_NaN = false;
- static const bool has_signaling_NaN = false;
- static const float_denorm_style has_denorm = denorm_absent;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return type(0);}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return type(0);}
-
- static const bool is_iec559 = false;
- static const bool is_bounded = true;
- static const bool is_modulo = false;
-
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_toward_zero;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = true;
+
+ static _LIBCPP_CONSTEXPR const bool is_signed = false;
+ static _LIBCPP_CONSTEXPR const int digits = 1;
+ static _LIBCPP_CONSTEXPR const int digits10 = 0;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 0;
+ static _LIBCPP_CONSTEXPR const type __min = false;
+ static _LIBCPP_CONSTEXPR const type __max = true;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_integer = true;
+ static _LIBCPP_CONSTEXPR const bool is_exact = true;
+ static _LIBCPP_CONSTEXPR const int radix = 2;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent = 0;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = 0;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = false;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = true;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = false;
+
+ static _LIBCPP_CONSTEXPR const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
template <>
@@ -296,44 +296,44 @@ class __libcpp_numeric_limits<float, true>
protected:
typedef float type;
- static const bool is_specialized = true;
-
- static const bool is_signed = true;
- static const int digits = __FLT_MANT_DIG__;
- static const int digits10 = __FLT_DIG__;
- static const int max_digits10 = 2+(digits * 30103)/100000;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __FLT_MIN__;}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __FLT_MAX__;}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
-
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const int radix = __FLT_RADIX__;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5F;}
-
- static const int min_exponent = __FLT_MIN_EXP__;
- static const int min_exponent10 = __FLT_MIN_10_EXP__;
- static const int max_exponent = __FLT_MAX_EXP__;
- static const int max_exponent10 = __FLT_MAX_10_EXP__;
-
- static const bool has_infinity = true;
- static const bool has_quiet_NaN = true;
- static const bool has_signaling_NaN = true;
- static const float_denorm_style has_denorm = denorm_present;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_valf();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
-
- static const bool is_iec559 = true;
- static const bool is_bounded = true;
- static const bool is_modulo = false;
-
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_to_nearest;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = true;
+
+ static _LIBCPP_CONSTEXPR const bool is_signed = true;
+ static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__;
+ static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+ static _LIBCPP_CONSTEXPR const bool is_integer = false;
+ static _LIBCPP_CONSTEXPR const bool is_exact = false;
+ static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __FLT_EPSILON__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5F;}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __FLT_MIN_EXP__;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __FLT_MIN_10_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __FLT_MAX_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __FLT_MAX_10_EXP__;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = true;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_valf();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = true;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = false;
+
+ static _LIBCPP_CONSTEXPR const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};
template <>
@@ -342,44 +342,44 @@ class __libcpp_numeric_limits<double, true>
protected:
typedef double type;
- static const bool is_specialized = true;
-
- static const bool is_signed = true;
- static const int digits = __DBL_MANT_DIG__;
- static const int digits10 = __DBL_DIG__;
- static const int max_digits10 = 2+(digits * 30103)/100000;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __DBL_MIN__;}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __DBL_MAX__;}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
-
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const int radix = __FLT_RADIX__;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
-
- static const int min_exponent = __DBL_MIN_EXP__;
- static const int min_exponent10 = __DBL_MIN_10_EXP__;
- static const int max_exponent = __DBL_MAX_EXP__;
- static const int max_exponent10 = __DBL_MAX_10_EXP__;
-
- static const bool has_infinity = true;
- static const bool has_quiet_NaN = true;
- static const bool has_signaling_NaN = true;
- static const float_denorm_style has_denorm = denorm_present;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_val();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
-
- static const bool is_iec559 = true;
- static const bool is_bounded = true;
- static const bool is_modulo = false;
-
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_to_nearest;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = true;
+
+ static _LIBCPP_CONSTEXPR const bool is_signed = true;
+ static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__;
+ static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+ static _LIBCPP_CONSTEXPR const bool is_integer = false;
+ static _LIBCPP_CONSTEXPR const bool is_exact = false;
+ static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __DBL_EPSILON__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __DBL_MIN_EXP__;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __DBL_MIN_10_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __DBL_MAX_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __DBL_MAX_10_EXP__;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = true;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_val();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nan("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nans("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = true;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = false;
+
+ static _LIBCPP_CONSTEXPR const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};
template <>
@@ -388,48 +388,48 @@ class __libcpp_numeric_limits<long double, true>
protected:
typedef long double type;
- static const bool is_specialized = true;
-
- static const bool is_signed = true;
- static const int digits = __LDBL_MANT_DIG__;
- static const int digits10 = __LDBL_DIG__;
- static const int max_digits10 = 2+(digits * 30103)/100000;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __LDBL_MIN__;}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __LDBL_MAX__;}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return -max();}
-
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const int radix = __FLT_RADIX__;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return 0.5;}
-
- static const int min_exponent = __LDBL_MIN_EXP__;
- static const int min_exponent10 = __LDBL_MIN_10_EXP__;
- static const int max_exponent = __LDBL_MAX_EXP__;
- static const int max_exponent10 = __LDBL_MAX_10_EXP__;
-
- static const bool has_infinity = true;
- static const bool has_quiet_NaN = true;
- static const bool has_signaling_NaN = true;
- static const float_denorm_style has_denorm = denorm_present;
- static const bool has_denorm_loss = false;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __builtin_huge_vall();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ static _LIBCPP_CONSTEXPR const bool is_specialized = true;
+
+ static _LIBCPP_CONSTEXPR const bool is_signed = true;
+ static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__;
+ static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
+
+ static _LIBCPP_CONSTEXPR const bool is_integer = false;
+ static _LIBCPP_CONSTEXPR const bool is_exact = false;
+ static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __LDBL_MAX_EXP__;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __LDBL_MAX_10_EXP__;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = true;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_vall();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
#if (defined(__ppc__) || defined(__ppc64__))
- static const bool is_iec559 = false;
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
#else
- static const bool is_iec559 = true;
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
#endif
- static const bool is_bounded = true;
- static const bool is_modulo = false;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = true;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = false;
- static const bool traps = false;
- static const bool tinyness_before = false;
- static const float_round_style round_style = round_to_nearest;
+ static _LIBCPP_CONSTEXPR const bool traps = false;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};
template <class _Tp>
@@ -439,43 +439,43 @@ class _LIBCPP_VISIBLE numeric_limits
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
typedef typename __base::type type;
public:
- static const bool is_specialized = __base::is_specialized;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
-
- static const int digits = __base::digits;
- static const int digits10 = __base::digits10;
- static const int max_digits10 = __base::max_digits10;
- static const bool is_signed = __base::is_signed;
- static const bool is_integer = __base::is_integer;
- static const bool is_exact = __base::is_exact;
- static const int radix = __base::radix;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
-
- static const int min_exponent = __base::min_exponent;
- static const int min_exponent10 = __base::min_exponent10;
- static const int max_exponent = __base::max_exponent;
- static const int max_exponent10 = __base::max_exponent10;
-
- static const bool has_infinity = __base::has_infinity;
- static const bool has_quiet_NaN = __base::has_quiet_NaN;
- static const bool has_signaling_NaN = __base::has_signaling_NaN;
- static const float_denorm_style has_denorm = __base::has_denorm;
- static const bool has_denorm_loss = __base::has_denorm_loss;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
- static const bool is_iec559 = __base::is_iec559;
- static const bool is_bounded = __base::is_bounded;
- static const bool is_modulo = __base::is_modulo;
-
- static const bool traps = __base::traps;
- static const bool tinyness_before = __base::tinyness_before;
- static const float_round_style round_style = __base::round_style;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+ static _LIBCPP_CONSTEXPR const int digits = __base::digits;
+ static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10;
+ static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
+ static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
+ static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
+ static _LIBCPP_CONSTEXPR const int radix = __base::radix;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+ static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};
template <class _Tp>
@@ -485,43 +485,43 @@ class _LIBCPP_VISIBLE numeric_limits<const _Tp>
typedef numeric_limits<_Tp> __base;
typedef _Tp type;
public:
- static const bool is_specialized = __base::is_specialized;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
-
- static const int digits = __base::digits;
- static const int digits10 = __base::digits10;
- static const int max_digits10 = __base::max_digits10;
- static const bool is_signed = __base::is_signed;
- static const bool is_integer = __base::is_integer;
- static const bool is_exact = __base::is_exact;
- static const int radix = __base::radix;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
-
- static const int min_exponent = __base::min_exponent;
- static const int min_exponent10 = __base::min_exponent10;
- static const int max_exponent = __base::max_exponent;
- static const int max_exponent10 = __base::max_exponent10;
-
- static const bool has_infinity = __base::has_infinity;
- static const bool has_quiet_NaN = __base::has_quiet_NaN;
- static const bool has_signaling_NaN = __base::has_signaling_NaN;
- static const float_denorm_style has_denorm = __base::has_denorm;
- static const bool has_denorm_loss = __base::has_denorm_loss;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
- static const bool is_iec559 = __base::is_iec559;
- static const bool is_bounded = __base::is_bounded;
- static const bool is_modulo = __base::is_modulo;
-
- static const bool traps = __base::traps;
- static const bool tinyness_before = __base::tinyness_before;
- static const float_round_style round_style = __base::round_style;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+ static _LIBCPP_CONSTEXPR const int digits = __base::digits;
+ static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10;
+ static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
+ static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
+ static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
+ static _LIBCPP_CONSTEXPR const int radix = __base::radix;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+ static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};
template <class _Tp>
@@ -531,43 +531,43 @@ class _LIBCPP_VISIBLE numeric_limits<volatile _Tp>
typedef numeric_limits<_Tp> __base;
typedef _Tp type;
public:
- static const bool is_specialized = __base::is_specialized;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
-
- static const int digits = __base::digits;
- static const int digits10 = __base::digits10;
- static const int max_digits10 = __base::max_digits10;
- static const bool is_signed = __base::is_signed;
- static const bool is_integer = __base::is_integer;
- static const bool is_exact = __base::is_exact;
- static const int radix = __base::radix;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
-
- static const int min_exponent = __base::min_exponent;
- static const int min_exponent10 = __base::min_exponent10;
- static const int max_exponent = __base::max_exponent;
- static const int max_exponent10 = __base::max_exponent10;
-
- static const bool has_infinity = __base::has_infinity;
- static const bool has_quiet_NaN = __base::has_quiet_NaN;
- static const bool has_signaling_NaN = __base::has_signaling_NaN;
- static const float_denorm_style has_denorm = __base::has_denorm;
- static const bool has_denorm_loss = __base::has_denorm_loss;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
- static const bool is_iec559 = __base::is_iec559;
- static const bool is_bounded = __base::is_bounded;
- static const bool is_modulo = __base::is_modulo;
-
- static const bool traps = __base::traps;
- static const bool tinyness_before = __base::tinyness_before;
- static const float_round_style round_style = __base::round_style;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+ static _LIBCPP_CONSTEXPR const int digits = __base::digits;
+ static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10;
+ static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
+ static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
+ static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
+ static _LIBCPP_CONSTEXPR const int radix = __base::radix;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+ static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};
template <class _Tp>
@@ -577,43 +577,43 @@ class _LIBCPP_VISIBLE numeric_limits<const volatile _Tp>
typedef numeric_limits<_Tp> __base;
typedef _Tp type;
public:
- static const bool is_specialized = __base::is_specialized;
- _LIBCPP_INLINE_VISIBILITY static type min() _NOEXCEPT {return __base::min();}
- _LIBCPP_INLINE_VISIBILITY static type max() _NOEXCEPT {return __base::max();}
- _LIBCPP_INLINE_VISIBILITY static type lowest() _NOEXCEPT {return __base::lowest();}
-
- static const int digits = __base::digits;
- static const int digits10 = __base::digits10;
- static const int max_digits10 = __base::max_digits10;
- static const bool is_signed = __base::is_signed;
- static const bool is_integer = __base::is_integer;
- static const bool is_exact = __base::is_exact;
- static const int radix = __base::radix;
- _LIBCPP_INLINE_VISIBILITY static type epsilon() _NOEXCEPT {return __base::epsilon();}
- _LIBCPP_INLINE_VISIBILITY static type round_error() _NOEXCEPT {return __base::round_error();}
-
- static const int min_exponent = __base::min_exponent;
- static const int min_exponent10 = __base::min_exponent10;
- static const int max_exponent = __base::max_exponent;
- static const int max_exponent10 = __base::max_exponent10;
-
- static const bool has_infinity = __base::has_infinity;
- static const bool has_quiet_NaN = __base::has_quiet_NaN;
- static const bool has_signaling_NaN = __base::has_signaling_NaN;
- static const float_denorm_style has_denorm = __base::has_denorm;
- static const bool has_denorm_loss = __base::has_denorm_loss;
- _LIBCPP_INLINE_VISIBILITY static type infinity() _NOEXCEPT {return __base::infinity();}
- _LIBCPP_INLINE_VISIBILITY static type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
- _LIBCPP_INLINE_VISIBILITY static type denorm_min() _NOEXCEPT {return __base::denorm_min();}
-
- static const bool is_iec559 = __base::is_iec559;
- static const bool is_bounded = __base::is_bounded;
- static const bool is_modulo = __base::is_modulo;
-
- static const bool traps = __base::traps;
- static const bool tinyness_before = __base::tinyness_before;
- static const float_round_style round_style = __base::round_style;
+ static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}
+
+ static _LIBCPP_CONSTEXPR const int digits = __base::digits;
+ static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10;
+ static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
+ static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
+ static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
+ static _LIBCPP_CONSTEXPR const int radix = __base::radix;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
+
+ static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent;
+ static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10;
+ static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent;
+ static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10;
+
+ static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity;
+ static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN;
+ static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
+ static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
+ static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}
+
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
+ static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
+ static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;
+
+ static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
+ static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
+ static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/memory b/include/memory
index aa24f960aecf..e30a6fd7c5b4 100644
--- a/include/memory
+++ b/include/memory
@@ -1685,39 +1685,21 @@ public:
::new((void*)__p) _Tp();
}
# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, const _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
- construct(pointer __p, _A0 __a0)
- {
- ::new((void*)__p) _Tp(_VSTD::move(__a0));
- }
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
template <class _A0, class _A1>
_LIBCPP_INLINE_VISIBILITY
@@ -1793,39 +1775,21 @@ public:
::new((void*)__p) _Tp();
}
# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, const _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
- construct(pointer __p, _A0 __a0)
- {
- ::new((void*)__p) _Tp(_VSTD::move(__a0));
- }
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
template <class _A0, class _A1>
_LIBCPP_INLINE_VISIBILITY
@@ -3086,6 +3050,18 @@ operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
return !(nullptr < __x);
}
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp, class _Dp>
+inline _LIBCPP_INLINE_VISIBILITY
+unique_ptr<_Tp, _Dp>
+move(unique_ptr<_Tp, _Dp>& __t)
+{
+ return unique_ptr<_Tp, _Dp>(__rv<unique_ptr<_Tp, _Dp> >(__t));
+}
+
+#endif
+
template <class _Tp> struct hash;
// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
diff --git a/include/random b/include/random
index 02ea9b630112..098332725c87 100644
--- a/include/random
+++ b/include/random
@@ -1659,7 +1659,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Sseq, class _Engine>
struct __is_seed_sequence
{
- static const bool value =
+ static _LIBCPP_CONSTEXPR const bool value =
!is_convertible<_Sseq, typename _Engine::result_type>::value &&
!is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
};
@@ -1837,24 +1837,24 @@ public:
private:
result_type __x_;
- static const result_type _Mp = result_type(~0);
+ static _LIBCPP_CONSTEXPR const result_type _Mp = result_type(~0);
static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");
static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");
public:
- static const result_type _Min = __c == 0u ? 1u: 0u;
- static const result_type _Max = __m - 1u;
+ static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u;
+ static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u;
static_assert(_Min < _Max, "linear_congruential_engine invalid parameters");
// engine characteristics
- static const/*expr*/ result_type multiplier = __a;
- static const/*expr*/ result_type increment = __c;
- static const/*expr*/ result_type modulus = __m;
+ static _LIBCPP_CONSTEXPR const result_type multiplier = __a;
+ static _LIBCPP_CONSTEXPR const result_type increment = __c;
+ static _LIBCPP_CONSTEXPR const result_type modulus = __m;
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() {return _Min;}
+ static _LIBCPP_CONSTEXPR result_type min() {return _Min;}
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() {return _Max;}
- static const/*expr*/ result_type default_seed = 1u;
+ static _LIBCPP_CONSTEXPR result_type max() {return _Max;}
+ static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -2074,7 +2074,7 @@ private:
static_assert( 0 < __m, "mersenne_twister_engine invalid parameters");
static_assert(__m <= __n, "mersenne_twister_engine invalid parameters");
- static const result_type _Dt = numeric_limits<result_type>::digits;
+ static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
static_assert(__w <= _Dt, "mersenne_twister_engine invalid parameters");
static_assert( 2 <= __w, "mersenne_twister_engine invalid parameters");
static_assert(__r <= __w, "mersenne_twister_engine invalid parameters");
@@ -2083,9 +2083,9 @@ private:
static_assert(__t <= __w, "mersenne_twister_engine invalid parameters");
static_assert(__l <= __w, "mersenne_twister_engine invalid parameters");
public:
- static const result_type _Min = 0;
- static const result_type _Max = __w == _Dt ? result_type(~0) :
- (result_type(1) << __w) - result_type(1);
+ static _LIBCPP_CONSTEXPR const result_type _Min = 0;
+ static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+ (result_type(1) << __w) - result_type(1);
static_assert(_Min < _Max, "mersenne_twister_engine invalid parameters");
static_assert(__a <= _Max, "mersenne_twister_engine invalid parameters");
static_assert(__b <= _Max, "mersenne_twister_engine invalid parameters");
@@ -2094,24 +2094,24 @@ public:
static_assert(__f <= _Max, "mersenne_twister_engine invalid parameters");
// engine characteristics
- static const/*expr*/ size_t word_size = __w;
- static const/*expr*/ size_t state_size = __n;
- static const/*expr*/ size_t shift_size = __m;
- static const/*expr*/ size_t mask_bits = __r;
- static const/*expr*/ result_type xor_mask = __a;
- static const/*expr*/ size_t tempering_u = __u;
- static const/*expr*/ result_type tempering_d = __d;
- static const/*expr*/ size_t tempering_s = __s;
- static const/*expr*/ result_type tempering_b = __b;
- static const/*expr*/ size_t tempering_t = __t;
- static const/*expr*/ result_type tempering_c = __c;
- static const/*expr*/ size_t tempering_l = __l;
- static const/*expr*/ result_type initialization_multiplier = __f;
- _LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() { return _Min; }
- _LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() { return _Max; }
- static const/*expr*/ result_type default_seed = 5489u;
+ static _LIBCPP_CONSTEXPR const size_t word_size = __w;
+ static _LIBCPP_CONSTEXPR const size_t state_size = __n;
+ static _LIBCPP_CONSTEXPR const size_t shift_size = __m;
+ static _LIBCPP_CONSTEXPR const size_t mask_bits = __r;
+ static _LIBCPP_CONSTEXPR const result_type xor_mask = __a;
+ static _LIBCPP_CONSTEXPR const size_t tempering_u = __u;
+ static _LIBCPP_CONSTEXPR const result_type tempering_d = __d;
+ static _LIBCPP_CONSTEXPR const size_t tempering_s = __s;
+ static _LIBCPP_CONSTEXPR const result_type tempering_b = __b;
+ static _LIBCPP_CONSTEXPR const size_t tempering_t = __t;
+ static _LIBCPP_CONSTEXPR const result_type tempering_c = __c;
+ static _LIBCPP_CONSTEXPR const size_t tempering_l = __l;
+ static _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f;
+ _LIBCPP_INLINE_VISIBILITY
+ static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
+ _LIBCPP_INLINE_VISIBILITY
+ static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
+ static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -2462,26 +2462,26 @@ private:
result_type __c_;
size_t __i_;
- static const result_type _Dt = numeric_limits<result_type>::digits;
+ static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
static_assert( 0 < __w, "subtract_with_carry_engine invalid parameters");
static_assert(__w <= _Dt, "subtract_with_carry_engine invalid parameters");
static_assert( 0 < __s, "subtract_with_carry_engine invalid parameters");
static_assert(__s < __r, "subtract_with_carry_engine invalid parameters");
public:
- static const result_type _Min = 0;
- static const result_type _Max = __w == _Dt ? result_type(~0) :
- (result_type(1) << __w) - result_type(1);
+ static _LIBCPP_CONSTEXPR const result_type _Min = 0;
+ static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+ (result_type(1) << __w) - result_type(1);
static_assert(_Min < _Max, "subtract_with_carry_engine invalid parameters");
// engine characteristics
- static const/*expr*/ size_t word_size = __w;
- static const/*expr*/ size_t short_lag = __s;
- static const/*expr*/ size_t long_lag = __r;
+ static _LIBCPP_CONSTEXPR const size_t word_size = __w;
+ static _LIBCPP_CONSTEXPR const size_t short_lag = __s;
+ static _LIBCPP_CONSTEXPR const size_t long_lag = __r;
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() { return _Min; }
+ static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() { return _Max; }
- static const/*expr*/ result_type default_seed = 19780503u;
+ static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
+ static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -2733,17 +2733,21 @@ public:
typedef typename _Engine::result_type result_type;
// engine characteristics
- static const/*expr*/ size_t block_size = __p;
- static const/*expr*/ size_t used_block = __r;
+ static _LIBCPP_CONSTEXPR const size_t block_size = __p;
+ static _LIBCPP_CONSTEXPR const size_t used_block = __r;
- // Temporary work around for lack of constexpr
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
+#else
+ static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
+ static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
+#endif
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() { return _Engine::min(); }
+ static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() { return _Engine::max(); }
+ static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -2889,12 +2893,12 @@ class _LIBCPP_VISIBLE independent_bits_engine
template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
class __get_n
{
- static const size_t _Dt = numeric_limits<_UI>::digits;
- static const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0);
- static const size_t _W0 = _Wp / _Np;
- static const _UI _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
+ static _LIBCPP_CONSTEXPR const size_t _Dt = numeric_limits<_UI>::digits;
+ static _LIBCPP_CONSTEXPR const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0);
+ static _LIBCPP_CONSTEXPR const size_t _W0 = _Wp / _Np;
+ static _LIBCPP_CONSTEXPR const _UI _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
public:
- static const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np;
+ static _LIBCPP_CONSTEXPR const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np;
};
public:
// types
@@ -2903,7 +2907,7 @@ public:
private:
_Engine __e_;
- static const result_type _Dt = numeric_limits<result_type>::digits;
+ static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits;
static_assert( 0 < __w, "independent_bits_engine invalid parameters");
static_assert(__w <= _Dt, "independent_bits_engine invalid parameters");
@@ -2914,36 +2918,40 @@ private:
result_type,
_Engine_result_type
>::type _Working_result_type;
- // Temporary work around for lack of constexpr
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
- + _Working_result_type(1);
- static const size_t __m = __log2<_Working_result_type, _Rp>::value;
- static const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value;
- static const size_t __w0 = __w / __n;
- static const size_t __n0 = __n - __w % __n;
- static const size_t _WDt = numeric_limits<_Working_result_type>::digits;
- static const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
- static const _Working_result_type __y0 = __w0 >= _WDt ? 0 :
- (_Rp >> __w0) << __w0;
- static const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 :
- (_Rp >> (__w0+1)) << (__w0+1);
- static const _Engine_result_type __mask0 = __w0 > 0 ?
+ + _Working_result_type(1);
+#else
+ static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+ + _Working_result_type(1);
+#endif
+ static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+ static _LIBCPP_CONSTEXPR const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value;
+ static _LIBCPP_CONSTEXPR const size_t __w0 = __w / __n;
+ static _LIBCPP_CONSTEXPR const size_t __n0 = __n - __w % __n;
+ static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+ static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+ static _LIBCPP_CONSTEXPR const _Working_result_type __y0 = __w0 >= _WDt ? 0 :
+ (_Rp >> __w0) << __w0;
+ static _LIBCPP_CONSTEXPR const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 :
+ (_Rp >> (__w0+1)) << (__w0+1);
+ static _LIBCPP_CONSTEXPR const _Engine_result_type __mask0 = __w0 > 0 ?
_Engine_result_type(~0) >> (_EDt - __w0) :
_Engine_result_type(0);
- static const _Engine_result_type __mask1 = __w0 < _EDt - 1 ?
+ static _LIBCPP_CONSTEXPR const _Engine_result_type __mask1 = __w0 < _EDt - 1 ?
_Engine_result_type(~0) >> (_EDt - (__w0 + 1)) :
_Engine_result_type(~0);
public:
- static const result_type _Min = 0;
- static const result_type _Max = __w == _Dt ? result_type(~0) :
- (result_type(1) << __w) - result_type(1);
+ static _LIBCPP_CONSTEXPR const result_type _Min = 0;
+ static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) :
+ (result_type(1) << __w) - result_type(1);
static_assert(_Min < _Max, "independent_bits_engine invalid parameters");
// engine characteristics
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() { return _Min; }
+ static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() { return _Max; }
+ static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -3121,23 +3129,23 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
template <uint64_t _Xp, uint64_t _Yp>
struct __ugcd
{
- static const uint64_t value = __ugcd<_Yp, _Xp % _Yp>::value;
+ static _LIBCPP_CONSTEXPR const uint64_t value = __ugcd<_Yp, _Xp % _Yp>::value;
};
template <uint64_t _Xp>
struct __ugcd<_Xp, 0>
{
- static const uint64_t value = _Xp;
+ static _LIBCPP_CONSTEXPR const uint64_t value = _Xp;
};
template <uint64_t _Np, uint64_t _Dp>
class __uratio
{
static_assert(_Dp != 0, "__uratio divide by 0");
- static const uint64_t __gcd = __ugcd<_Np, _Dp>::value;
+ static _LIBCPP_CONSTEXPR const uint64_t __gcd = __ugcd<_Np, _Dp>::value;
public:
- static const uint64_t num = _Np / __gcd;
- static const uint64_t den = _Dp / __gcd;
+ static _LIBCPP_CONSTEXPR const uint64_t num = _Np / __gcd;
+ static _LIBCPP_CONSTEXPR const uint64_t den = _Dp / __gcd;
typedef __uratio<num, den> type;
};
@@ -3157,17 +3165,22 @@ private:
public:
// engine characteristics
- static const/*expr*/ size_t table_size = __k;
+ static _LIBCPP_CONSTEXPR const size_t table_size = __k;
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
+#else
+ static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
+ static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
+#endif
static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type min() { return _Min; }
+ static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
_LIBCPP_INLINE_VISIBILITY
- static const/*expr*/ result_type max() { return _Max; }
+ static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
- static const unsigned long long _Rp = _Max - _Min + 1ull;
+ static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;
// constructors and seeding functions
_LIBCPP_INLINE_VISIBILITY
@@ -3370,13 +3383,13 @@ public:
typedef unsigned result_type;
// generator characteristics
- static const result_type _Min = 0;
- static const result_type _Max = 0xFFFFFFFFu;
+ static _LIBCPP_CONSTEXPR const result_type _Min = 0;
+ static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;
_LIBCPP_INLINE_VISIBILITY
- static constexpr result_type min() { return _Min;}
+ static _LIBCPP_CONSTEXPR result_type min() { return _Min;}
_LIBCPP_INLINE_VISIBILITY
- static constexpr result_type max() { return _Max;}
+ static _LIBCPP_CONSTEXPR result_type max() { return _Max;}
// constructors
explicit random_device(const string& __token = "/dev/urandom");
@@ -3522,13 +3535,17 @@ generate_canonical(_URNG& __g)
{
const size_t _Dt = numeric_limits<_RealType>::digits;
const size_t __b = _Dt < __bits ? _Dt : __bits;
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
+#else
+ const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
+#endif
const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0);
- const _RealType _Rp = _URNG::_Max - _URNG::_Min + _RealType(1);
+ const _RealType _Rp = _URNG::max() - _URNG::min() + _RealType(1);
_RealType __base = _Rp;
- _RealType _Sp = __g() - _URNG::_Min;
+ _RealType _Sp = __g() - _URNG::min();
for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp)
- _Sp += (__g() - _URNG::_Min) * __base;
+ _Sp += (__g() - _URNG::min()) * __base;
return _Sp / __base;
}
diff --git a/include/system_error b/include/system_error
index 805c64648833..e9f2b55eac13 100644
--- a/include/system_error
+++ b/include/system_error
@@ -366,8 +366,8 @@ class _LIBCPP_VISIBLE error_category
public:
virtual ~error_category() _NOEXCEPT;
-private:
error_category() _NOEXCEPT;
+private:
error_category(const error_category&);// = delete;
error_category& operator=(const error_category&);// = delete;
diff --git a/include/tuple b/include/tuple
index 2bdb05fbc091..683c9dd5294c 100644
--- a/include/tuple
+++ b/include/tuple
@@ -552,7 +552,7 @@ public:
) {}
template <class ..._Up,
- class = typename enable_if
+ typename enable_if
<
sizeof...(_Up) <= sizeof...(_Tp) &&
__tuple_convertible
@@ -562,8 +562,40 @@ public:
sizeof...(_Up) < sizeof...(_Tp) ?
sizeof...(_Up) :
sizeof...(_Tp)>::type
- >::value
- >::type
+ >::value,
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ tuple(_Up&&... __u)
+ : base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
+ typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
+ _VSTD::forward<_Up>(__u)...) {}
+
+ template <class ..._Up,
+ typename enable_if
+ <
+ sizeof...(_Up) <= sizeof...(_Tp) &&
+ __tuple_constructible
+ <
+ tuple<_Up...>,
+ typename __make_tuple_types<tuple,
+ sizeof...(_Up) < sizeof...(_Tp) ?
+ sizeof...(_Up) :
+ sizeof...(_Tp)>::type
+ >::value &&
+ !__tuple_convertible
+ <
+ tuple<_Up...>,
+ typename __make_tuple_types<tuple,
+ sizeof...(_Up) < sizeof...(_Tp) ?
+ sizeof...(_Up) :
+ sizeof...(_Tp)>::type
+ >::value,
+ bool
+ >::type =false
>
_LIBCPP_INLINE_VISIBILITY
explicit
@@ -598,15 +630,29 @@ public:
_VSTD::forward<_Up>(__u)...) {}
template <class _Tuple,
- class = typename enable_if
+ typename enable_if
<
- __tuple_convertible<_Tuple, tuple>::value
- >::type
+ __tuple_convertible<_Tuple, tuple>::value,
+ bool
+ >::type = false
>
_LIBCPP_INLINE_VISIBILITY
tuple(_Tuple&& __t)
: base_(_VSTD::forward<_Tuple>(__t)) {}
+ template <class _Tuple,
+ typename enable_if
+ <
+ __tuple_constructible<_Tuple, tuple>::value &&
+ !__tuple_convertible<_Tuple, tuple>::value,
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit
+ tuple(_Tuple&& __t)
+ : base_(_VSTD::forward<_Tuple>(__t)) {}
+
template <class _Alloc, class _Tuple,
class = typename enable_if
<
diff --git a/include/type_traits b/include/type_traits
index 13129f31d665..a54e25204eeb 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -163,22 +163,15 @@ struct __two {char _[2];};
template <class _Tp, _Tp __v>
struct _LIBCPP_VISIBLE integral_constant
{
- static constexpr _Tp value = __v;
+ static _LIBCPP_CONSTEXPR const _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant type;
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
- constexpr
-#endif
- operator value_type()
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
- const
-#endif
- {return value;}
+ _LIBCPP_CONSTEXPR operator value_type() const {return value;}
};
template <class _Tp, _Tp __v>
-constexpr _Tp integral_constant<_Tp, __v>::value;
+_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
@@ -1305,24 +1298,8 @@ forward(typename std::remove_reference<_Tp>::type&& __t) _NOEXCEPT
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-class __rv
-{
- typedef typename remove_reference<_Tp>::type _Trr;
- _Trr& t_;
-public:
- _LIBCPP_INLINE_VISIBILITY
- _Trr* operator->() {return &t_;}
- _LIBCPP_INLINE_VISIBILITY
- explicit __rv(_Trr& __t) : t_(__t) {}
-};
-
-template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_convertible<_Tp, __rv<_Tp> >::value,
- _Tp&
->::type
+_Tp&
move(_Tp& __t)
{
return __t;
@@ -1330,11 +1307,7 @@ move(_Tp& __t)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_convertible<_Tp, __rv<_Tp> >::value,
- const _Tp&
->::type
+const _Tp&
move(const _Tp& __t)
{
return __t;
@@ -1342,63 +1315,24 @@ move(const _Tp& __t)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_convertible<_Tp, __rv<_Tp> >::value,
- _Tp
->::type
-move(_Tp& __t)
-{
- return _Tp(__rv<_Tp>(__t));
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_convertible<_Tp, __rv<_Tp> >::value,
- typename add_lvalue_reference<_Tp>::type
->::type
-forward(_Up& __t)
-{
- return __t;
-}
-
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_convertible<_Tp, __rv<_Tp> >::value,
- typename add_lvalue_reference<_Tp>::type
->::type
-forward(const _Up& __t)
+_Tp&
+forward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT
{
return __t;
}
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_convertible<_Tp, __rv<_Tp> >::value,
- _Tp
->::type
-forward(_Up& __t)
-{
- return _Tp(__rv<_Tp>(__t));
-}
-template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_convertible<_Tp, __rv<_Tp> >::value,
- _Tp
->::type
-forward(const _Up& __t)
+template <class _Tp>
+class __rv
{
- return _Tp(__rv<_Tp>(__t));
-}
+ typedef typename remove_reference<_Tp>::type _Trr;
+ _Trr& t_;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ _Trr* operator->() {return &t_;}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __rv(_Trr& __t) : t_(__t) {}
+};
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/utility b/include/utility
index 7facea3a649e..279d42188821 100644
--- a/include/utility
+++ b/include/utility
@@ -206,8 +206,11 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
}
struct _LIBCPP_VISIBLE piecewise_construct_t { };
-//constexpr
+#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
+#else
+constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+#endif
template <class _T1, class _T2>
struct _LIBCPP_VISIBLE pair
@@ -221,7 +224,7 @@ struct _LIBCPP_VISIBLE pair
// pair(const pair&) = default;
// pair(pair&&) = default;
- _LIBCPP_INLINE_VISIBILITY pair() : first(), second() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
: first(__x), second(__y) {}
diff --git a/src/iostream.cpp b/src/iostream.cpp
index 157c3977d478..bfb1bfb85e38 100644
--- a/src/iostream.cpp
+++ b/src/iostream.cpp
@@ -9,45 +9,58 @@
#include "__std_stream"
#include "string"
+#include "new"
_LIBCPP_BEGIN_NAMESPACE_STD
-static __stdinbuf<char> __cin(stdin);
-static __stdoutbuf<char> __cout(stdout);
-static __stdoutbuf<char> __cerr(stderr);
-static __stdinbuf<wchar_t> __wcin(stdin);
-static __stdoutbuf<wchar_t> __wcout(stdout);
-static __stdoutbuf<wchar_t> __wcerr(stderr);
-
-istream cin(&__cin);
-ostream cout(&__cout);
-ostream cerr(&__cerr);
-ostream clog(&__cerr);
-wistream wcin(&__wcin);
-wostream wcout(&__wcout);
-wostream wcerr(&__wcerr);
-wostream wclog(&__wcerr);
+alignas (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
+alignas (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
+alignas (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
+alignas (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf <wchar_t>)];
+alignas (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
+alignas (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
+
+alignas (istream) char cin [sizeof(istream)];
+alignas (ostream) char cout[sizeof(ostream)];
+alignas (ostream) char cerr[sizeof(ostream)];
+alignas (ostream) char clog[sizeof(ostream)];
+alignas (wistream) char wcin [sizeof(wistream)];
+alignas (wostream) char wcout[sizeof(wostream)];
+alignas (wostream) char wcerr[sizeof(wostream)];
+alignas (wostream) char wclog[sizeof(wostream)];
ios_base::Init __start_std_streams;
ios_base::Init::Init()
{
- cin.tie(&cout);
- _VSTD::unitbuf(cerr);
- cerr.tie(&cout);
+ istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin) );
+ ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout));
+ ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr));
+ ::new(clog) ostream(cerr_ptr->rdbuf());
+ cin_ptr->tie(cout_ptr);
+ _VSTD::unitbuf(*cerr_ptr);
+ cerr_ptr->tie(cout_ptr);
- wcin.tie(&wcout);
- _VSTD::unitbuf(wcerr);
- wcerr.tie(&wcout);
+ wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin) );
+ wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout));
+ wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr));
+ ::new(wclog) wostream(wcerr_ptr->rdbuf());
+ wcin_ptr->tie(wcout_ptr);
+ _VSTD::unitbuf(*wcerr_ptr);
+ wcerr_ptr->tie(wcout_ptr);
}
ios_base::Init::~Init()
{
- cout.flush();
- clog.flush();
+ ostream* cout_ptr = (ostream*)cout;
+ ostream* clog_ptr = (ostream*)clog;
+ cout_ptr->flush();
+ clog_ptr->flush();
- wcout.flush();
- wclog.flush();
+ wostream* wcout_ptr = (wostream*)wcout;
+ wostream* wclog_ptr = (wostream*)wclog;
+ wcout_ptr->flush();
+ wclog_ptr->flush();
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index b516b0ca68b3..9fa4f593137a 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -15,7 +15,11 @@
#include <cstdint>
#include <cstddef>
#include "system_error"
+
+// Use <cxxabi.h> to determine whether we're linking against libc++abi.
+#if __has_include(<cxxabi.h>)
#include <cxxabi.h>
+#endif
// Note: optimize for size
diff --git a/src/utility.cpp b/src/utility.cpp
index 7dccffb73e5a..e9830e7c24f0 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#define _LIBCPP_BUILDING_UTILITY
#include "utility"
_LIBCPP_BEGIN_NAMESPACE_STD