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
4 
5 #include <boost/smart_ptr/local_shared_ptr.hpp>
6 #include <boost/core/lightweight_test.hpp>
7 #include <boost/config.hpp>
8 #include <functional>
9 
10 #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
11 
main()12 int main() {}
13 
14 #else
15 
main()16 int main()
17 {
18     {
19         boost::local_shared_ptr<int> p1, p2( new int );
20 
21         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int> >()( p1 ), std::hash< int* >()( p1.get() ) );
22         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int> >()( p2 ), std::hash< int* >()( p2.get() ) );
23     }
24 
25     {
26         boost::local_shared_ptr<int[]> p1, p2( new int[1] );
27 
28         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int[]> >()( p1 ), std::hash< int* >()( p1.get() ) );
29         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int[]> >()( p2 ), std::hash< int* >()( p2.get() ) );
30     }
31 
32     {
33         boost::local_shared_ptr<int[1]> p1, p2( new int[1] );
34 
35         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int[1]> >()( p1 ), std::hash< int* >()( p1.get() ) );
36         BOOST_TEST_EQ( std::hash< boost::local_shared_ptr<int[1]> >()( p2 ), std::hash< int* >()( p2.get() ) );
37     }
38 
39     return boost::report_errors();
40 }
41 
42 #endif // #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
43