2 Copyright 2007 Tobias Schwinger
4 Copyright 2019 Glen Joseph Fernandes
7 Distributed under the Boost Software License, Version 1.0.
8 (http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/functional/value_factory.hpp>
11 #include <boost/core/lightweight_test.hpp>
15 explicit sum(int i0 = 0, int i1 = 0, int i2 = 0, int i3 = 0,
16 int i4 = 0, int i5 = 0, int i6 = 0, int i7 = 0,
17 int i8 = 0, int i9 = 0)
18 : value_(i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9) { }
30 boost::value_factory<sum> x;
43 BOOST_TEST(s.get() == 0);
47 BOOST_TEST(s.get() == 1);
51 BOOST_TEST(s.get() == 3);
55 BOOST_TEST(s.get() == 6);
59 BOOST_TEST(s.get() == 10);
62 sum s(x(a, b, c, d, e));
63 BOOST_TEST(s.get() == 15);
66 sum s(x(a, b, c, d, e, f));
67 BOOST_TEST(s.get() == 21);
70 sum s(x(a, b, c, d, e, f, g));
71 BOOST_TEST(s.get() == 28);
74 sum s(x(a, b, c, d, e, f, g, h));
75 BOOST_TEST(s.get() == 36);
78 sum s(x(a, b, c, d, e, f, g, h, i));
79 BOOST_TEST(s.get() == 45);
82 sum s(x(a, b, c, d, e, f, g, h, i, j));
83 BOOST_TEST(s.get() == 55);
85 return boost::report_errors();