1 #include <boost/config.hpp>
3 // sp_convertible_test.cpp
5 // Copyright (c) 2008 Peter Dimov
7 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
11 #include <boost/detail/lightweight_test.hpp>
12 #include <boost/shared_ptr.hpp>
30 int f( boost::shared_ptr<void const> )
35 int f( boost::shared_ptr<int> )
40 int f( boost::shared_ptr<incomplete> )
45 int g( boost::shared_ptr<X> )
50 int g( boost::shared_ptr<Y> )
55 int g( boost::shared_ptr<incomplete> )
62 boost::shared_ptr<double> p1;
63 BOOST_TEST( 1 == f( p1 ) );
64 BOOST_TEST( 1 == f( boost::shared_ptr<double>() ) );
66 boost::shared_ptr<Z> p2;
67 BOOST_TEST( 4 == g( p2 ) );
68 BOOST_TEST( 4 == g( boost::shared_ptr<Z>() ) );
70 return boost::report_errors();