1
dnl Copyright 2002, The libsigc++ Development Team
3
dnl This library is free software; you can redistribute it and/or
4
dnl modify it under the terms of the GNU Lesser General Public
5
dnl License as published by the Free Software Foundation; either
6
dnl version 2.1 of the License, or (at your option) any later version.
8
dnl This library is distributed in the hope that it will be useful,
9
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
dnl Lesser General Public License for more details.
13
dnl You should have received a copy of the GNU Lesser General Public
14
dnl License along with this library; if not, write to the Free Software
15
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
include(template.macros.m4)
21
dnl Macros to make select arguments
22
define([LAMBDA_SELECT_DO],[dnl
23
template <LOOP(class T_arg%1, $2)>
24
dnl T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
25
T_arg$1 operator ()(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
27
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
28
template <LOOP(class T_arg%1, $2)>
29
//Does not work: T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return operator()( LOOP(_A_%1, $2) ); }
30
T_arg$1 sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
34
define([LAMBDA_SELECT],[dnl
35
struct lambda_select$1 : public lambda_base
37
template <LOOP(class T_arg%1=void,$2)>
38
struct deduce_result_type
39
{ typedef T_arg$1 type; };
40
typedef void result_type; // no operator ()() overload
42
void operator ()() const; // not implemented
43
FOR($1, $2,[[LAMBDA_SELECT_DO($1,%1)]])dnl
49
#ifndef _SIGC_LAMBDA_SELECT_HPP_
50
#define _SIGC_LAMBDA_SELECT_HPP_
51
#include <sigc++/adaptors/lambda/base.h>
56
FOR(1,CALL_SIZE,[[LAMBDA_SELECT(%1,CALL_SIZE)]])
57
} /* namespace internal */
59
FOR(1,CALL_SIZE,[[extern SIGC_API const lambda<internal::lambda_select%1> _%1;
62
} /* namespace sigc */
64
#endif /* _SIGC_LAMBDA_SELECT_HPP_ */