Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82351 - in trunk/boost/smart_ptr: . detail
From: pdimov_at_[hidden]
Date: 2013-01-04 10:41:15


Author: pdimov
Date: 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
New Revision: 82351
URL: http://svn.boost.org/trac/boost/changeset/82351

Log:
Replace std::nullptr_t with boost::detail::sp_nullptr_t.
Added:
   trunk/boost/smart_ptr/detail/sp_nullptr_t.hpp (contents, props changed)
Text files modified:
   trunk/boost/smart_ptr/intrusive_ptr.hpp | 9 +++++----
   trunk/boost/smart_ptr/scoped_array.hpp | 10 +++++-----
   trunk/boost/smart_ptr/scoped_ptr.hpp | 9 +++++----
   trunk/boost/smart_ptr/shared_array.hpp | 9 +++++----
   trunk/boost/smart_ptr/shared_ptr.hpp | 19 ++++++++++---------
   5 files changed, 30 insertions(+), 26 deletions(-)

Added: trunk/boost/smart_ptr/detail/sp_nullptr_t.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/smart_ptr/detail/sp_nullptr_t.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -0,0 +1,45 @@
+#ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// detail/sp_nullptr_t.hpp
+//
+// Copyright 2013 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+#include <cstddef>
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+namespace boost
+{
+
+namespace detail
+{
+
+#if defined( __clang__ ) && !defined( _LIBCPP_VERSION ) && !defined( BOOST_NO_CXX11_DECLTYPE )
+
+ typedef decltype(nullptr) sp_nullptr_t;
+
+#else
+
+ typedef std::nullptr_t sp_nullptr_t;
+
+#endif
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // !defined( BOOST_NO_CXX11_NULLPTR )
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED

Modified: trunk/boost/smart_ptr/intrusive_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/intrusive_ptr.hpp (original)
+++ trunk/boost/smart_ptr/intrusive_ptr.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -18,6 +18,7 @@
 #include <boost/assert.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/smart_ptr/detail/sp_convertible.hpp>
+#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
 
 #include <boost/config/no_tr1/functional.hpp> // for std::less
 
@@ -220,22 +221,22 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
-template<class T> inline bool operator==( intrusive_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator==( std::nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator!=( intrusive_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }
 
-template<class T> inline bool operator!=( std::nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }

Modified: trunk/boost/smart_ptr/scoped_array.hpp
==============================================================================
--- trunk/boost/smart_ptr/scoped_array.hpp (original)
+++ trunk/boost/smart_ptr/scoped_array.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -14,7 +14,7 @@
 #include <boost/config.hpp>
 #include <boost/assert.hpp>
 #include <boost/checked_delete.hpp>
-#include <boost/config.hpp> // in case ptrdiff_t not in std
+#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
 
 #include <boost/detail/workaround.hpp>
 
@@ -100,22 +100,22 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
-template<class T> inline bool operator==( scoped_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( scoped_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator==( std::nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( boost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator!=( scoped_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( scoped_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }
 
-template<class T> inline bool operator!=( std::nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }

Modified: trunk/boost/smart_ptr/scoped_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/scoped_ptr.hpp (original)
+++ trunk/boost/smart_ptr/scoped_ptr.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -14,6 +14,7 @@
 #include <boost/config.hpp>
 #include <boost/assert.hpp>
 #include <boost/checked_delete.hpp>
+#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
 #include <boost/detail/workaround.hpp>
 
 #ifndef BOOST_NO_AUTO_PTR
@@ -117,22 +118,22 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
-template<class T> inline bool operator==( scoped_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( scoped_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator==( std::nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( boost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator!=( scoped_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( scoped_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }
 
-template<class T> inline bool operator!=( std::nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }

Modified: trunk/boost/smart_ptr/shared_array.hpp
==============================================================================
--- trunk/boost/smart_ptr/shared_array.hpp (original)
+++ trunk/boost/smart_ptr/shared_array.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -27,6 +27,7 @@
 
 #include <boost/smart_ptr/shared_ptr.hpp>
 #include <boost/smart_ptr/detail/shared_count.hpp>
+#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
 #include <boost/detail/workaround.hpp>
 
 #include <cstddef> // for std::ptrdiff_t
@@ -245,22 +246,22 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
-template<class T> inline bool operator==( shared_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator==( std::nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator!=( shared_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }
 
-template<class T> inline bool operator!=( std::nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }

Modified: trunk/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/shared_ptr.hpp (original)
+++ trunk/boost/smart_ptr/shared_ptr.hpp 2013-01-04 10:41:13 EST (Fri, 04 Jan 2013)
@@ -32,6 +32,7 @@
 #include <boost/smart_ptr/detail/shared_count.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/smart_ptr/detail/sp_convertible.hpp>
+#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
 
 #if !defined(BOOST_SP_NO_ATOMIC_ACCESS)
 #include <boost/smart_ptr/detail/spinlock_pool.hpp>
@@ -41,7 +42,7 @@
 #include <algorithm> // for std::swap
 #include <functional> // for std::less
 #include <typeinfo> // for std::bad_cast
-#include <cstddef> // for std::size_t, std::nullptr_t
+#include <cstddef> // for std::size_t
 
 #if !defined(BOOST_NO_IOSTREAM)
 #if !defined(BOOST_NO_IOSFWD)
@@ -341,7 +342,7 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
- shared_ptr( std::nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws
+ shared_ptr( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws
     {
     }
 
@@ -366,7 +367,7 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
- template<class D> shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, d )
+ template<class D> shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d )
     {
     }
 
@@ -381,7 +382,7 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
- template<class D, class A> shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, d, a )
+ template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a )
     {
     }
 
@@ -605,7 +606,7 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
- shared_ptr & operator=( std::nullptr_t ) BOOST_NOEXCEPT // never throws
+ shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
     {
         this_type().swap(*this);
         return *this;
@@ -752,22 +753,22 @@
 
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
-template<class T> inline bool operator==( shared_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator==( std::nullptr_t, shared_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() == 0;
 }
 
-template<class T> inline bool operator!=( shared_ptr<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }
 
-template<class T> inline bool operator!=( std::nullptr_t, shared_ptr<T> const & p ) BOOST_NOEXCEPT
+template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     return p.get() != 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk