blob: 5462ffb041174d6aa2723465c63198e43d4d278b [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -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/detail/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( ndnboost::value_factory< sum >()(one,two) );
25 BOOST_TEST(instance == 3);
26 }
27 return ndnboost::report_errors();
28}
29