blob: 1c1a46774e8bce04b5178967a3e42736d542de33 [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10#ifndef TEST_FUNC_H
11#define TEST_FUNC_H
12
13class test_func
14{
15 int id_;
16public:
17 typedef int first_argument_type;
18 typedef double second_argument_type;
19 typedef long double result_type;
20
21 explicit test_func(int id) : id_(id) {}
22
23 int id() const {return id_;}
24
25 result_type operator() (const first_argument_type& x, second_argument_type& y) const
26 {return x+y;}
27 result_type operator() (const first_argument_type& x, const second_argument_type& y) const
28 {return x-y;}
29 result_type operator() (first_argument_type& x, const second_argument_type& y) const
30 {return x*y;}
31};
32
Howard Hinnant5cf4e1f2010-08-22 00:20:12 +000033#endif // TEST_FUNC_H