diff options
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/atomic | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/std/bitset | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/std/fstream | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/std/functional | 21 | ||||
-rw-r--r-- | libstdc++-v3/include/std/iterator | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/std/mutex | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/std/regex | 35 | ||||
-rw-r--r-- | libstdc++-v3/include/std/thread | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/std/tuple | 19 | ||||
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 36 | ||||
-rw-r--r-- | libstdc++-v3/include/std/valarray | 3 |
11 files changed, 65 insertions, 63 deletions
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 5ef52f3763f..d4f685ced54 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -38,8 +38,8 @@ # include <bits/c++0x_warning.h> #endif +#include <bits/c++config.h> #include <bits/atomic_base.h> -#include <cstddef> _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index b23b51a78fe..32ca0917062 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -45,7 +45,6 @@ #pragma GCC system_header -#include <cstddef> // For size_t #include <string> #include <bits/functexcept.h> // For invalid_argument, out_of_range, // overflow_error diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream index 9aa4f1ab10f..00690bee938 100644 --- a/libstdc++-v3/include/std/fstream +++ b/libstdc++-v3/include/std/fstream @@ -397,7 +397,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) if (__testout && __off == 0 && _M_buf_size > 1 ) this->setp(_M_buf, _M_buf + _M_buf_size - 1); else - this->setp(NULL, NULL); + this->setp(0, 0); } }; @@ -795,7 +795,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out) - : __iostream_type(NULL), _M_filebuf() + : __iostream_type(0), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); @@ -810,7 +810,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) explicit basic_fstream(const std::string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out) - : __iostream_type(NULL), _M_filebuf() + : __iostream_type(0), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index b6cc6d5e072..752e78325a3 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -1384,13 +1384,6 @@ namespace std class bad_function_call : public std::exception { }; /** - * The integral constant expression 0 can be converted into a - * pointer to this type. It is used by the function template to - * accept NULL pointers. - */ - struct _M_clear_type; - - /** * Trait identifying "location-invariant" types, meaning that the * address of the object (or any of its members) will not escape. * Also implies a trivial copy constructor and assignment operator. @@ -1797,10 +1790,10 @@ namespace std function() : _Function_base() { } /** - * @brief Default construct creates an empty function call wrapper. + * @brief Creates an empty function call wrapper. * @post @c !(bool)*this */ - function(_M_clear_type*) : _Function_base() { } + function(nullptr_t) : _Function_base() { } /** * @brief %Function copy constructor. @@ -1893,7 +1886,7 @@ namespace std * The target of @c *this is deallocated, leaving it empty. */ function& - operator=(_M_clear_type*) + operator=(nullptr_t) { if (_M_manager) { @@ -2139,13 +2132,13 @@ namespace std */ template<typename _Res, typename... _Args> inline bool - operator==(const function<_Res(_Args...)>& __f, _M_clear_type*) + operator==(const function<_Res(_Args...)>& __f, nullptr_t) { return !static_cast<bool>(__f); } /// @overload template<typename _Res, typename... _Args> inline bool - operator==(_M_clear_type*, const function<_Res(_Args...)>& __f) + operator==(nullptr_t, const function<_Res(_Args...)>& __f) { return !static_cast<bool>(__f); } /** @@ -2157,13 +2150,13 @@ namespace std */ template<typename _Res, typename... _Args> inline bool - operator!=(const function<_Res(_Args...)>& __f, _M_clear_type*) + operator!=(const function<_Res(_Args...)>& __f, nullptr_t) { return static_cast<bool>(__f); } /// @overload template<typename _Res, typename... _Args> inline bool - operator!=(_M_clear_type*, const function<_Res(_Args...)>& __f) + operator!=(nullptr_t, const function<_Res(_Args...)>& __f) { return static_cast<bool>(__f); } // [20.7.15.2.7] specialized algorithms diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator index a15bdf9744c..5395106ae6a 100644 --- a/libstdc++-v3/include/std/iterator +++ b/libstdc++-v3/include/std/iterator @@ -1,6 +1,6 @@ // <iterator> -*- C++ -*- -// Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2009, 2010 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -58,7 +58,6 @@ #pragma GCC system_header #include <bits/c++config.h> -#include <cstddef> #include <bits/stl_iterator_base_types.h> #include <bits/stl_iterator_base_funcs.h> #include <bits/stl_iterator.h> diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index be435cd38e5..b236f0db91d 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -37,7 +37,6 @@ #else #include <tuple> -#include <cstddef> #include <chrono> #include <exception> #include <type_traits> diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex index e8238299b22..95ad4239459 100644 --- a/libstdc++-v3/include/std/regex +++ b/libstdc++-v3/include/std/regex @@ -35,33 +35,30 @@ # include <bits/c++0x_warning.h> #else -#if defined(_GLIBCXX_INCLUDE_AS_TR1) -# error C++0x header cannot be included from TR1 header -#endif - #include <algorithm> #include <bitset> +#include <functional> +#ifdef _GLIBCXX_DEBUG +# include <iosfwd> +#endif #include <iterator> #include <locale> +#include <memory> +#include <set> +#include <sstream> +#include <stack> #include <stdexcept> #include <string> -#include <vector> #include <utility> -#include <sstream> +#include <vector> -#if defined(_GLIBCXX_INCLUDE_AS_CXX0X) -# include <tr1_impl/regex> -#else -# define _GLIBCXX_INCLUDE_AS_CXX0X -# define _GLIBCXX_BEGIN_NAMESPACE_TR1 -# define _GLIBCXX_END_NAMESPACE_TR1 -# define _GLIBCXX_TR1 -# include <tr1_impl/regex> -# undef _GLIBCXX_TR1 -# undef _GLIBCXX_END_NAMESPACE_TR1 -# undef _GLIBCXX_BEGIN_NAMESPACE_TR1 -# undef _GLIBCXX_INCLUDE_AS_CXX0X -#endif +#include <bits/regex_constants.h> +#include <bits/regex_error.h> +#include <bits/regex_cursor.h> +#include <bits/regex_nfa.h> +#include <bits/regex_compiler.h> +#include <bits/regex_grep_matcher.h> +#include <bits/regex.h> #endif // __GXX_EXPERIMENTAL_CXX0X__ diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index 470f2c0f35c..c348c76bc40 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -40,7 +40,6 @@ #include <memory> #include <mutex> #include <condition_variable> -#include <cstddef> #include <bits/functexcept.h> #include <bits/functional_hash.h> #include <bits/gthr.h> diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index f9aa14f2057..8b2252e3686 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -238,8 +238,7 @@ namespace std tuple(_UElements&&... __elements) : _Inherited(std::forward<_UElements>(__elements)...) { } - tuple(const tuple& __in) - : _Inherited(static_cast<const _Inherited&>(__in)) { } + tuple(const tuple&) = default; tuple(tuple&& __in) : _Inherited(static_cast<_Inherited&&>(__in)) { } @@ -321,8 +320,7 @@ namespace std tuple(_U1&& __a1, _U2&& __a2) : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { } - tuple(const tuple& __in) - : _Inherited(static_cast<const _Inherited&>(__in)) { } + tuple(const tuple&) = default; tuple(tuple&& __in) : _Inherited(static_cast<_Inherited&&>(__in)) { } @@ -341,7 +339,8 @@ namespace std template<typename _U1, typename _U2> tuple(pair<_U1, _U2>&& __in) - : _Inherited(std::move(__in.first), std::move(__in.second)) { } + : _Inherited(std::forward<_U1>(__in.first), + std::forward<_U2>(__in.second)) { } tuple& operator=(const tuple& __in) @@ -690,16 +689,12 @@ namespace std struct _Swallow_assign { template<class _Tp> - _Swallow_assign& - operator=(const _Tp&) + const _Swallow_assign& + operator=(const _Tp&) const { return *this; } }; - // TODO: Put this in some kind of shared file. - namespace - { - _Swallow_assign ignore; - }; // anonymous namespace + const _Swallow_assign ignore{}; /** * Stores a tuple of indices. Used by bind() to extract the elements diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 9831851c4a5..42a462e53a5 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -39,7 +39,7 @@ # error C++0x header cannot be included from TR1 header #endif -#include <cstddef> +#include <bits/c++config.h> #if defined(_GLIBCXX_INCLUDE_AS_CXX0X) # include <tr1_impl/type_traits> @@ -193,7 +193,7 @@ namespace std { }; template<typename _Tp> - typename add_rvalue_reference<_Tp>::type declval(); + typename add_rvalue_reference<_Tp>::type declval() noexcept; template<typename _Tp, typename... _Args> class __is_constructible_helper @@ -234,6 +234,28 @@ namespace std _Args...>::__value> { }; + template<bool, typename _Tp, typename... _Args> + struct __is_nt_constructible_helper + { static const bool __value = false; }; + + template<typename _Tp, typename... _Args> + struct __is_nt_constructible_helper<true, _Tp, _Args...> + { static const bool __value = noexcept(_Tp(declval<_Args>()...)); }; + + template<typename _Tp, typename _Arg> + struct __is_nt_constructible_helper<true, _Tp, _Arg> + { + static const bool __value = noexcept(static_cast<_Tp>(declval<_Arg>())); + }; + + /// is_nothrow_constructible + template<typename _Tp, typename... _Args> + struct is_nothrow_constructible + : public integral_constant<bool, + __is_nt_constructible_helper<is_constructible<_Tp, _Args...>::value, + _Tp, _Args...>::__value> + { }; + /// has_trivial_default_constructor template<typename _Tp> struct has_trivial_default_constructor @@ -246,9 +268,9 @@ namespace std : public integral_constant<bool, __has_trivial_copy(_Tp)> { }; - /// has_trivial_assign + /// has_trivial_copy_assign template<typename _Tp> - struct has_trivial_assign + struct has_trivial_copy_assign : public integral_constant<bool, __has_trivial_assign(_Tp)> { }; @@ -270,9 +292,9 @@ namespace std : public integral_constant<bool, __has_nothrow_copy(_Tp)> { }; - /// has_nothrow_assign + /// has_nothrow_copy_assign template<typename _Tp> - struct has_nothrow_assign + struct has_nothrow_copy_assign : public integral_constant<bool, __has_nothrow_assign(_Tp)> { }; @@ -649,7 +671,7 @@ namespace std template<typename _Tp> inline typename add_rvalue_reference<_Tp>::type - declval() + declval() noexcept { static_assert(__declval_protector<_Tp>::__stop, "declval() must not be used!"); diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray index fa92751791d..f15ac92b0bf 100644 --- a/libstdc++-v3/include/std/valarray +++ b/libstdc++-v3/include/std/valarray @@ -1,7 +1,7 @@ // The template and inlines for the -*- C++ -*- valarray class. // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009 +// 2006, 2007, 2008, 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -36,7 +36,6 @@ #pragma GCC system_header #include <bits/c++config.h> -#include <cstddef> #include <cmath> #include <algorithm> #include <debug/debug.h> |