Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | 5b08a8a | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
Howard Hinnant | 412dbeb | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef TEST_FUNC_H |
| 11 | #define TEST_FUNC_H |
| 12 | |
| 13 | class test_func |
| 14 | { |
| 15 | int id_; |
| 16 | public: |
| 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 Hinnant | 5cf4e1f | 2010-08-22 00:20:12 +0000 | [diff] [blame] | 33 | #endif // TEST_FUNC_H |