2 Copyright 2019 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/functional/factory.hpp>
9 #include <boost/core/default_allocator.hpp>
10 #include <boost/core/lightweight_test.hpp>
11 #include <boost/smart_ptr/shared_ptr.hpp>
12 #include <boost/config.hpp>
15 #if defined(BOOST_NO_EXCEPTIONS)
18 BOOST_NORETURN
void throw_exception(const std::exception
&)
44 boost::shared_ptr
<sum
> s(boost::factory
<boost::shared_ptr
<sum
>,
45 boost::default_allocator
<void>,
46 boost::factory_alloc_for_pointee_and_deleter
>()(a
, b
));
47 BOOST_TEST(s
->get() == 3);
50 boost::shared_ptr
<sum
> s(boost::factory
<boost::shared_ptr
<sum
>,
51 boost::default_allocator
<void>,
52 boost::factory_passes_alloc_to_smart_pointer
>()(a
, b
));
53 BOOST_TEST(s
->get() == 3);
55 return boost::report_errors();