blob: 331757d3acbe730440724181f8a5fbe8c6b0bf66 [file] [log] [blame]
Brian Silvermanf14e1af2018-08-04 23:36:29 -07001/*=============================================================================
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>
10#include <boost/core/lightweight_test.hpp>
11
12class 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
20int 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