]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/ip_hash_test2.cpp
1 // Copyright 2011, 2020 Peter Dimov
2 // Distributed under the Boost Software License, Version 1.0.
3 // https://www.boost.org/LICENSE_1_0.txt
5 #include <boost/intrusive_ptr.hpp>
6 #include <boost/core/lightweight_test.hpp>
7 #include <boost/config.hpp>
10 #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
23 base
& operator=(base
const &);
37 long use_count() const
42 inline friend void intrusive_ptr_add_ref(base
* p
)
47 inline friend void intrusive_ptr_release(base
* p
)
49 if(--p
->use_count_
== 0) delete p
;
59 boost::intrusive_ptr
<X
> p1
, p2( new X
);
61 BOOST_TEST_EQ( std::hash
< boost::intrusive_ptr
<X
> >()( p1
), std::hash
< X
* >()( p1
.get() ) );
62 BOOST_TEST_EQ( std::hash
< boost::intrusive_ptr
<X
> >()( p2
), std::hash
< X
* >()( p2
.get() ) );
64 return boost::report_errors();
67 #endif // #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)