1 #ifndef BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
10 // detail/local_sp_deleter.hpp
12 // Copyright 2017 Peter Dimov
14 // Distributed under the Boost Software License, Version 1.0. (See
15 // accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 // See http://www.boost.org/libs/smart_ptr/ for documentation.
20 #include <boost/smart_ptr/detail/local_counted_base.hpp>
21 #include <boost/config.hpp>
29 template<class D> class local_sp_deleter: public local_counted_impl_em
37 local_sp_deleter(): d_()
41 explicit local_sp_deleter( D const& d ) BOOST_SP_NOEXCEPT: d_( d )
45 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
47 explicit local_sp_deleter( D&& d ) BOOST_SP_NOEXCEPT: d_( std::move(d) )
58 template<class Y> void operator()( Y* p ) BOOST_SP_NOEXCEPT
63 #if !defined( BOOST_NO_CXX11_NULLPTR )
65 void operator()( boost::detail::sp_nullptr_t p ) BOOST_SP_NOEXCEPT
73 template<> class local_sp_deleter<void>
77 template<class D> D * get_local_deleter( local_sp_deleter<D> * p )
82 inline void * get_local_deleter( local_sp_deleter<void> * /*p*/ )
91 #endif // #ifndef BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED