diff options
| author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-05 17:43:29 +0000 |
|---|---|---|
| committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-05 17:43:29 +0000 |
| commit | 5ca15eb9b4d7819b369922c34128d30ba2a69079 (patch) | |
| tree | c01380bc3ca54784033b951564396f685cc40d3d /libstdc++-v3/include/std/functional | |
| parent | 251a613eb0d8871e5d961286b66ce27f1d5ab58b (diff) | |
| download | ppe42-gcc-5ca15eb9b4d7819b369922c34128d30ba2a69079.tar.gz ppe42-gcc-5ca15eb9b4d7819b369922c34128d30ba2a69079.zip | |
2010-06-05 Magnus Fromreide <magfr@lysator.liu.se>
Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/functional (function): Add nullptr_t support.
* include/bits/shared_ptr.h (shared_ptr): Likewise.
* include/bits/unique_ptr.h (unique_ptr): Likewise.
2010-06-05 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/shared_ptr_base.h (__shared_ptr): Add nullptr_t support.
(__shared_count): Add nullptr_t support and make constructors explicit.
* testsuite/20_util/shared_ptr/cons/43820.cc: Adjust.
* testsuite/20_util/shared_ptr/cons/nullptr.cc: New.
* testsuite/20_util/unique_ptr/cons/nullptr.cc: New.
* testsuite/20_util/unique_ptr/assign/nullptr.cc: New.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Adjust.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/functional')
| -rw-r--r-- | libstdc++-v3/include/std/functional | 21 |
1 files changed, 7 insertions, 14 deletions
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 |

