]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2007 Tobias Schwinger | |
3 | ||
4 | Use modification and distribution are subject to the Boost Software | |
5 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
6 | http://www.boost.org/LICENSE_1_0.txt). | |
7 | ==============================================================================*/ | |
8 | ||
9 | #include <boost/functional/value_factory.hpp> | |
11fdf7f2 | 10 | #include <boost/core/lightweight_test.hpp> |
7c673cae FG |
11 | |
12 | class sum | |
13 | { | |
14 | int val_sum; | |
15 | public: | |
16 | sum(int a, int b) : val_sum(a + b) { } | |
17 | operator int() const { return this->val_sum; } | |
18 | }; | |
19 | ||
20 | int main() | |
21 | { | |
22 | int one = 1, two = 2; | |
23 | { | |
24 | sum instance( boost::value_factory< sum >()(one,two) ); | |
25 | BOOST_TEST(instance == 3); | |
26 | } | |
27 | return boost::report_errors(); | |
28 | } | |
29 |