2 Copyright 2007 Tobias Schwinger
3 Copyright 2017 Daniel James
5 Copyright 2019 Glen Joseph Fernandes
8 Distributed under the Boost Software License, Version 1.0.
9 (http://www.boost.org/LICENSE_1_0.txt)
11 #include <boost/functional/factory.hpp>
12 #include <boost/core/lightweight_test.hpp>
13 #include <boost/smart_ptr/shared_ptr.hpp>
34 boost::shared_ptr
<sum
> s(boost::factory
<boost::shared_ptr
<sum
>,
36 boost::factory_alloc_for_pointee_and_deleter
>()(a
, b
));
37 BOOST_TEST(s
->get() == 3);
40 boost::shared_ptr
<sum
> s(boost::factory
<boost::shared_ptr
<sum
>,
42 boost::factory_passes_alloc_to_smart_pointer
>()(a
, b
));
43 BOOST_TEST(s
->get() == 3);
45 return boost::report_errors();