diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/std')
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/array | 40 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/atomic | 10 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/chrono | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/complex | 12 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/functional | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/future | 3 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/iomanip | 2 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/mutex | 7 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/shared_mutex | 16 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/tuple | 31 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/type_traits | 19 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/utility | 9 |
12 files changed, 103 insertions, 50 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/std/array b/gcc-4.9/libstdc++-v3/include/std/array index 67680d6..b7abeb0 100644 --- a/gcc-4.9/libstdc++-v3/include/std/array +++ b/gcc-4.9/libstdc++-v3/include/std/array @@ -48,9 +48,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { typedef _Tp _Type[_Nm]; - static constexpr _Tp& - _S_ref(const _Type& __t, std::size_t __n) noexcept - { return const_cast<_Tp&>(__t[__n]); } + static constexpr _Tp* + _S_ptr(const _Type& __t, std::size_t __n) noexcept + { return const_cast<_Tp*>(std::__addressof(__t[__n])); } }; template<typename _Tp> @@ -58,9 +58,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { struct _Type { }; - static constexpr _Tp& - _S_ref(const _Type&, std::size_t) noexcept - { return *static_cast<_Tp*>(nullptr); } + static constexpr _Tp* + _S_ptr(const _Type&, std::size_t) noexcept + { return static_cast<_Tp*>(nullptr); } }; /** @@ -170,11 +170,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // Element access. reference operator[](size_type __n) noexcept - { return _AT_Type::_S_ref(_M_elems, __n); } + { return *_AT_Type::_S_ptr(_M_elems, __n); } constexpr const_reference operator[](size_type __n) const noexcept - { return _AT_Type::_S_ref(_M_elems, __n); } + { return *_AT_Type::_S_ptr(_M_elems, __n); } reference at(size_type __n) @@ -183,7 +183,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " ">= _Nm (which is %zu)"), __n, _Nm); - return _AT_Type::_S_ref(_M_elems, __n); + return *_AT_Type::_S_ptr(_M_elems, __n); } constexpr const_reference @@ -191,11 +191,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { // Result of conditional expression must be an lvalue so use // boolean ? lvalue : (throw-expr, lvalue) - return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) + return __n < _Nm ? *_AT_Type::_S_ptr(_M_elems, __n) : (std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " ">= _Nm (which is %zu)"), __n, _Nm), - _AT_Type::_S_ref(_M_elems, 0)); + *_AT_Type::_S_ptr(_M_elems, 0)); } reference @@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER constexpr const_reference front() const noexcept - { return _AT_Type::_S_ref(_M_elems, 0); } + { return *_AT_Type::_S_ptr(_M_elems, 0); } reference back() noexcept @@ -213,17 +213,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER constexpr const_reference back() const noexcept { - return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1) - : _AT_Type::_S_ref(_M_elems, 0); + return _Nm ? *_AT_Type::_S_ptr(_M_elems, _Nm - 1) + : *_AT_Type::_S_ptr(_M_elems, 0); } pointer data() noexcept - { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); } + { return _AT_Type::_S_ptr(_M_elems, 0); } const_pointer data() const noexcept - { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); } + { return _AT_Type::_S_ptr(_M_elems, 0); } }; // Array comparisons. @@ -272,8 +272,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER get(array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); - return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: - _S_ref(__arr._M_elems, _Int); + return *_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: + _S_ptr(__arr._M_elems, _Int); } template<std::size_t _Int, typename _Tp, std::size_t _Nm> @@ -289,8 +289,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER get(const array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); - return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: - _S_ref(__arr._M_elems, _Int); + return *_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: + _S_ptr(__arr._M_elems, _Int); } _GLIBCXX_END_NAMESPACE_CONTAINER diff --git a/gcc-4.9/libstdc++-v3/include/std/atomic b/gcc-4.9/libstdc++-v3/include/std/atomic index ece75a4..3711446 100644 --- a/gcc-4.9/libstdc++-v3/include/std/atomic +++ b/gcc-4.9/libstdc++-v3/include/std/atomic @@ -161,7 +161,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct atomic { private: - _Tp _M_i; + // Align 1/2/4/8/16-byte types to at least their size. + static constexpr int _S_min_alignment + = (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16 + ? 0 : sizeof(_Tp); + + static constexpr int _S_alignment + = _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp); + + alignas(_S_alignment) _Tp _M_i; public: atomic() noexcept = default; diff --git a/gcc-4.9/libstdc++-v3/include/std/chrono b/gcc-4.9/libstdc++-v3/include/std/chrono index b114e02..6e9c7dc 100644 --- a/gcc-4.9/libstdc++-v3/include/std/chrono +++ b/gcc-4.9/libstdc++-v3/include/std/chrono @@ -782,6 +782,8 @@ _GLIBCXX_END_NAMESPACE_VERSION #if __cplusplus > 201103L +#define __cpp_lib_chrono_udls 201304 + inline namespace literals { inline namespace chrono_literals diff --git a/gcc-4.9/libstdc++-v3/include/std/complex b/gcc-4.9/libstdc++-v3/include/std/complex index 34fa1dd..3104b58 100644 --- a/gcc-4.9/libstdc++-v3/include/std/complex +++ b/gcc-4.9/libstdc++-v3/include/std/complex @@ -44,8 +44,14 @@ #include <cmath> #include <sstream> -// Get rid of a macro possibly defined in <complex.h> -#undef complex +// The C++ <complex> header is incompatible with the C99 <complex.h> header, +// they cannot be included into a single translation unit portably. Notably, +// C++11's <ccomplex> does not include C99's <complex.h> and in C++11's +// <complex.h> is defined to provide only what C++11's <ccomplex> does in a +// different namespace. +#ifdef _GLIBCXX_C99_COMPLEX_H +#error Cannot include both <complex> and C99's <complex.h> +#endif namespace std _GLIBCXX_VISIBILITY(default) { @@ -1929,6 +1935,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline namespace literals { inline namespace complex_literals { +#define __cpp_lib_complex_udls 201309 + constexpr std::complex<float> operator""if(long double __num) { return std::complex<float>{0.0F, static_cast<float>(__num)}; } diff --git a/gcc-4.9/libstdc++-v3/include/std/functional b/gcc-4.9/libstdc++-v3/include/std/functional index 0e80fa3..fac1c67 100644 --- a/gcc-4.9/libstdc++-v3/include/std/functional +++ b/gcc-4.9/libstdc++-v3/include/std/functional @@ -2407,9 +2407,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) { if (static_cast<bool>(__x)) { + __x._M_manager(_M_functor, __x._M_functor, __clone_functor); _M_invoker = __x._M_invoker; _M_manager = __x._M_manager; - __x._M_manager(_M_functor, __x._M_functor, __clone_functor); } } diff --git a/gcc-4.9/libstdc++-v3/include/std/future b/gcc-4.9/libstdc++-v3/include/std/future index d446b9d..6523cea 100644 --- a/gcc-4.9/libstdc++-v3/include/std/future +++ b/gcc-4.9/libstdc++-v3/include/std/future @@ -1450,7 +1450,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(_ArgTypes... __args) { __future_base::_State_base::_S_check(_M_state); - _M_state->_M_run(std::forward<_ArgTypes>(__args)...); + auto __state = _M_state; + __state->_M_run(std::forward<_ArgTypes>(__args)...); } void diff --git a/gcc-4.9/libstdc++-v3/include/std/iomanip b/gcc-4.9/libstdc++-v3/include/std/iomanip index cc6f60c..9b2cc7a 100644 --- a/gcc-4.9/libstdc++-v3/include/std/iomanip +++ b/gcc-4.9/libstdc++-v3/include/std/iomanip @@ -339,6 +339,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus > 201103L +#define __cpp_lib_quoted_string_io 201304 + _GLIBCXX_END_NAMESPACE_VERSION namespace __detail { _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/gcc-4.9/libstdc++-v3/include/std/mutex b/gcc-4.9/libstdc++-v3/include/std/mutex index 8e9dd27..c6b7f13 100644 --- a/gcc-4.9/libstdc++-v3/include/std/mutex +++ b/gcc-4.9/libstdc++-v3/include/std/mutex @@ -648,12 +648,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { int __idx; auto __locks = std::tie(__l1, __l2, __l3...); - __try - { __try_lock_impl<0>::__do_try_lock(__locks, __idx); } - __catch(const __cxxabiv1::__forced_unwind&) - { __throw_exception_again; } - __catch(...) - { } + __try_lock_impl<0>::__do_try_lock(__locks, __idx); return __idx; } diff --git a/gcc-4.9/libstdc++-v3/include/std/shared_mutex b/gcc-4.9/libstdc++-v3/include/std/shared_mutex index 53b39f8..c193eb2 100644 --- a/gcc-4.9/libstdc++-v3/include/std/shared_mutex +++ b/gcc-4.9/libstdc++-v3/include/std/shared_mutex @@ -36,10 +36,8 @@ #else #include <bits/c++config.h> -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) -# include <mutex> -# include <condition_variable> -#endif +#include <mutex> +#include <condition_variable> #include <bits/functexcept.h> namespace std _GLIBCXX_VISIBILITY(default) @@ -51,7 +49,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 +#ifdef _GLIBCXX_HAS_GTHREADS + +#define __cpp_lib_shared_timed_mutex 201402 + /// shared_timed_mutex class shared_timed_mutex { @@ -251,7 +253,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } }; -#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 +#endif // _GLIBCXX_HAS_GTHREADS /// shared_lock template<typename _Mutex> @@ -390,6 +392,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept { __x.swap(__y); } +#endif // _GLIBCXX_USE_C99_STDINT_TR1 + // @} group mutexes _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/gcc-4.9/libstdc++-v3/include/std/tuple b/gcc-4.9/libstdc++-v3/include/std/tuple index 103c99e..6e0577d 100644 --- a/gcc-4.9/libstdc++-v3/include/std/tuple +++ b/gcc-4.9/libstdc++-v3/include/std/tuple @@ -88,21 +88,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Head_base(const _Head& __h) : _Head(__h) { } - template<typename _UHead, typename = typename - enable_if<!is_convertible<_UHead, - __uses_alloc_base>::value>::type> + constexpr _Head_base(const _Head_base&) = default; + constexpr _Head_base(_Head_base&&) = default; + + template<typename _UHead> constexpr _Head_base(_UHead&& __h) : _Head(std::forward<_UHead>(__h)) { } - _Head_base(__uses_alloc0) + _Head_base(allocator_arg_t, __uses_alloc0) : _Head() { } template<typename _Alloc> - _Head_base(__uses_alloc1<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _Head(allocator_arg, *__a._M_a) { } template<typename _Alloc> - _Head_base(__uses_alloc2<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _Head(*__a._M_a) { } template<typename _UHead> @@ -133,21 +134,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Head_base(const _Head& __h) : _M_head_impl(__h) { } - template<typename _UHead, typename = typename - enable_if<!is_convertible<_UHead, - __uses_alloc_base>::value>::type> + constexpr _Head_base(const _Head_base&) = default; + constexpr _Head_base(_Head_base&&) = default; + + template<typename _UHead> constexpr _Head_base(_UHead&& __h) : _M_head_impl(std::forward<_UHead>(__h)) { } - _Head_base(__uses_alloc0) + _Head_base(allocator_arg_t, __uses_alloc0) : _M_head_impl() { } template<typename _Alloc> - _Head_base(__uses_alloc1<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _M_head_impl(allocator_arg, *__a._M_a) { } template<typename _Alloc> - _Head_base(__uses_alloc2<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _M_head_impl(*__a._M_a) { } template<typename _UHead> @@ -285,7 +287,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Alloc> _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a), - _Base(__use_alloc<_Head>(__a)) { } + _Base(__tag, __use_alloc<_Head>(__a)) { } template<typename _Alloc> _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, @@ -774,6 +776,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION tuple<_Elements...>>::type&&>(get<__i>(__t)); } #if __cplusplus > 201103L + +#define __cpp_lib_tuples_by_type 201304 + template<typename _Head, size_t __i, typename... _Tail> constexpr typename __add_ref<_Head>::type __get_helper2(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept diff --git a/gcc-4.9/libstdc++-v3/include/std/type_traits b/gcc-4.9/libstdc++-v3/include/std/type_traits index 9a5c06e..6f439f5 100644 --- a/gcc-4.9/libstdc++-v3/include/std/type_traits +++ b/gcc-4.9/libstdc++-v3/include/std/type_traits @@ -73,6 +73,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef integral_constant<_Tp, __v> type; constexpr operator value_type() const { return value; } #if __cplusplus > 201103L + +#define __cpp_lib_integral_constant_callable 201304 + constexpr value_type operator()() const { return value; } #endif }; @@ -480,6 +483,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct is_function<_Res(_ArgTypes......) const volatile &&> : public true_type { }; +#define __cpp_lib_is_null_pointer 201309 + template<typename> struct __is_null_pointer_helper : public false_type { }; @@ -634,6 +639,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public integral_constant<bool, __is_polymorphic(_Tp)> { }; +#if __cplusplus > 201103L + /// is_final + #define __cpp_lib_is_final 201402L + template<typename _Tp> + struct is_final + : public integral_constant<bool, __is_final(_Tp)> + { }; +#endif + /// is_abstract template<typename _Tp> struct is_abstract @@ -1451,6 +1465,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; #if __cplusplus > 201103L + +#define __cpp_lib_transformation_trait_aliases 201304 + /// Alias template for remove_const template<typename _Tp> using remove_const_t = typename remove_const<_Tp>::type; @@ -2048,6 +2065,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Sfinae-friendly result_of implementation: +#define __cpp_lib_result_of_sfinae 201210 + // [func.require] paragraph 1 bullet 1: struct __result_of_memfun_ref_impl { diff --git a/gcc-4.9/libstdc++-v3/include/std/utility b/gcc-4.9/libstdc++-v3/include/std/utility index 4da9209..694220d 100644 --- a/gcc-4.9/libstdc++-v3/include/std/utility +++ b/gcc-4.9/libstdc++-v3/include/std/utility @@ -70,6 +70,7 @@ #include <bits/stl_pair.h> #if __cplusplus >= 201103L + #include <bits/move.h> #include <initializer_list> @@ -153,6 +154,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __pair_get<_Int>::__const_get(__in); } #if __cplusplus > 201103L + +#define __cpp_lib_tuples_by_type 201304 + template <typename _Tp, typename _Up> constexpr _Tp& get(pair<_Tp, _Up>& __p) noexcept @@ -183,6 +187,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION get(pair<_Up, _Tp>&& __p) noexcept { return std::move(__p.second); } +#define __cpp_lib_exchange_function 201304 + /// Assign @p __new_val to @p __obj and return its previous value. template <typename _Tp, typename _Up = _Tp> inline _Tp @@ -216,6 +222,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; #if __cplusplus > 201103L + +#define __cpp_lib_integer_sequence 201304 + /// Class template integer_sequence template<typename _Tp, _Tp... _Idx> struct integer_sequence |