]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/functional/factory/test/factory_args.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / functional / factory / test / factory_args.cpp
CommitLineData
92f5a8d4
TL
1/*
2Copyright 2019 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed under the Boost Software License, Version 1.0.
6(http://www.boost.org/LICENSE_1_0.txt)
7*/
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>
14
15class sum {
16public:
17 explicit sum(int a = 0, int b = 0, int c = 0, int d = 0,
18 int e = 0, int f = 0, int g = 0, int h = 0,
19 int i = 0, int j = 0, int k = 0, int l = 0)
20 : value_(a + b + c + d + e + f + g + h + i + j + k + l) { }
21
22 int get() const {
23 return value_;
24 }
25
26private:
27 int value_;
28};
29
30int main()
31{
32 boost::scoped_ptr<sum> s(boost::factory<sum*>()(1, 2, 3, 4, 5, 6, 7, 8, 9,
33 10, 11, 12));
34 BOOST_TEST(s->get() == 78);
35 return boost::report_errors();
36}
37#else
38int main()
39{
40 return 0;
41}
42#endif