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/config.hpp>
9 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
10 !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
11 #include <boost/functional/factory.hpp>
12 #include <boost/core/lightweight_test.hpp>
13 #include <boost/smart_ptr/scoped_ptr.hpp>
21 : value_(a.value_) { }
33 explicit sum(arg&& a1, arg&& a2)
34 : value_(a1.get() + a2.get()) { }
46 boost::scoped_ptr<sum> s(boost::factory<sum*>()(arg(1), arg(2)));
47 BOOST_TEST(s->get() == 3);
48 return boost::report_errors();