File: select.h.m4

package info (click to toggle)
libsigc%2B%2B-2.0 2.12.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,432 kB
  • sloc: cpp: 4,132; xml: 339; python: 196; makefile: 192; sh: 5
file content (77 lines) | stat: -rw-r--r-- 2,532 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
dnl Copyright 2002, The libsigc++ Development Team 
dnl 
dnl This library is free software; you can redistribute it and/or 
dnl modify it under the terms of the GNU Lesser General Public 
dnl License as published by the Free Software Foundation; either 
dnl version 2.1 of the License, or (at your option) any later version. 
dnl 
dnl This library is distributed in the hope that it will be useful, 
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
dnl Lesser General Public License for more details. 
dnl 
dnl You should have received a copy of the GNU Lesser General Public 
dnl License along with this library; if not, write to the Free Software 
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
divert(-1)
include(template.macros.m4)

dnl
dnl Macros to make select arguments
define([LAMBDA_SELECT_DO],[dnl
  template <LOOP(class T_arg%1, $2)>
dnl T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
  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; }

  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
  template <LOOP(class T_arg%1, $2)>
  //Does not work: T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return operator()( LOOP(_A_%1, $2) ); }
  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; }
  #endif
  
])
define([LAMBDA_SELECT],[dnl
struct lambda_select$1 : public lambda_base
{
  template <LOOP(class T_arg%1=void,$2)>
  struct deduce_result_type
    { typedef T_arg$1 type; };
  typedef void result_type; // no operator ()() overload

  void operator ()() const; // not implemented
FOR($1, $2,[[LAMBDA_SELECT_DO($1,%1)]])dnl
};

])
define([LAMBDA_SELECTOR],[dnl
/** Lambda selector.
 *
 * @deprecated Use C++11 lambda expressions or %std::bind() instead of libsigc++ lambdas and sigc::group().
 *
 * @ingroup lambdas
 */
extern SIGC_API const lambda<internal::lambda_select$1> _$1;

])

divert(0)dnl
#ifndef _SIGC_LAMBDA_SELECT_HPP_
#define _SIGC_LAMBDA_SELECT_HPP_
#include <sigc++/adaptors/lambda/base.h>

_DEPRECATE_IFDEF_START

namespace sigc {

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace internal {
FOR(1,CALL_SIZE,[[LAMBDA_SELECT(%1,CALL_SIZE)]])dnl
} /* namespace internal */

#endif // DOXYGEN_SHOULD_SKIP_THIS
} /* namespace sigc */

_DEPRECATE_IFDEF_END

#endif /* _SIGC_LAMBDA_SELECT_HPP_ */