~ubuntu-branches/ubuntu/vivid/ardour/vivid-proposed

« back to all changes in this revision

Viewing changes to libs/sigc++2/sigc++/adaptors/lambda/macros/select.h.m4

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler, Jaromír Mikeš, Felipe Sateler
  • Date: 2014-05-22 14:39:25 UTC
  • mfrom: (29 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: package-import@ubuntu.com-20140522143925-vwqfo9287pmkrroe
Tags: 1:2.8.16+git20131003-3
* Team upload

[ Jaromír Mikeš ]
* Add -dbg package

[ Felipe Sateler ]
* Upload to experimental

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copyright 2002, The libsigc++ Development Team 
 
2
dnl 
 
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. 
 
7
dnl 
 
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. 
 
12
dnl 
 
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
 
16
dnl
 
17
divert(-1)
 
18
include(template.macros.m4)
 
19
 
 
20
dnl
 
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; }
 
26
 
 
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; }
 
31
  #endif
 
32
  
 
33
])
 
34
define([LAMBDA_SELECT],[dnl
 
35
struct lambda_select$1 : public lambda_base
 
36
{
 
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
 
41
 
 
42
  void operator ()() const; // not implemented
 
43
FOR($1, $2,[[LAMBDA_SELECT_DO($1,%1)]])dnl
 
44
};
 
45
 
 
46
])
 
47
 
 
48
divert(0)dnl
 
49
#ifndef _SIGC_LAMBDA_SELECT_HPP_
 
50
#define _SIGC_LAMBDA_SELECT_HPP_
 
51
#include <sigc++/adaptors/lambda/base.h>
 
52
 
 
53
namespace sigc {
 
54
 
 
55
namespace internal {
 
56
FOR(1,CALL_SIZE,[[LAMBDA_SELECT(%1,CALL_SIZE)]])
 
57
} /* namespace internal */
 
58
 
 
59
FOR(1,CALL_SIZE,[[extern SIGC_API const lambda<internal::lambda_select%1> _%1;
 
60
]])
 
61
 
 
62
} /* namespace sigc */
 
63
 
 
64
#endif /* _SIGC_LAMBDA_SELECT_HPP_ */