xref: /minix3/external/bsd/libc++/dist/libcxx/test/depr/depr.lib.binders/test_func.h (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
2*4684ddb6SLionel Sambuc //
3*4684ddb6SLionel Sambuc //                     The LLVM Compiler Infrastructure
4*4684ddb6SLionel Sambuc //
5*4684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*4684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*4684ddb6SLionel Sambuc //
8*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
9*4684ddb6SLionel Sambuc 
10*4684ddb6SLionel Sambuc #ifndef TEST_FUNC_H
11*4684ddb6SLionel Sambuc #define TEST_FUNC_H
12*4684ddb6SLionel Sambuc 
13*4684ddb6SLionel Sambuc class test_func
14*4684ddb6SLionel Sambuc {
15*4684ddb6SLionel Sambuc     int id_;
16*4684ddb6SLionel Sambuc public:
17*4684ddb6SLionel Sambuc     typedef int first_argument_type;
18*4684ddb6SLionel Sambuc     typedef double second_argument_type;
19*4684ddb6SLionel Sambuc     typedef long double result_type;
20*4684ddb6SLionel Sambuc 
test_func(int id)21*4684ddb6SLionel Sambuc     explicit test_func(int id) : id_(id) {}
22*4684ddb6SLionel Sambuc 
id()23*4684ddb6SLionel Sambuc     int id() const {return id_;}
24*4684ddb6SLionel Sambuc 
operator()25*4684ddb6SLionel Sambuc     result_type operator() (const first_argument_type& x, second_argument_type& y) const
26*4684ddb6SLionel Sambuc         {return x+y;}
operator()27*4684ddb6SLionel Sambuc     result_type operator() (const first_argument_type& x, const second_argument_type& y) const
28*4684ddb6SLionel Sambuc         {return x-y;}
operator()29*4684ddb6SLionel Sambuc     result_type operator() (first_argument_type& x, const second_argument_type& y) const
30*4684ddb6SLionel Sambuc         {return x*y;}
31*4684ddb6SLionel Sambuc };
32*4684ddb6SLionel Sambuc 
33*4684ddb6SLionel Sambuc #endif  // TEST_FUNC_H
34