-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApplySequence.h
36 lines (36 loc) · 1.19 KB
/
ApplySequence.h
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
//template<class Seq,class T,class R>
//void apply(Seq& sq,R(T::*f)()const){//通过指向对象的指针,访问对象的成员函数
// typename Seq::iterator it=sq.begin();
// while (it!=sq.end())
// {
// ((*it++)->*f)();
// }
//}
//template<class Seq,class T,class R,class A>
//void apply(Seq& sq,R(T::*f)(A)const,A a){
// typename Seq::iterator it=sq.begin();
// while(it!=sq.end()) ((*it++)->*f)(a);
//}
//template<class Seq,class T,class R,class A1,class A2>
//void apply(Seq &seq,R(T::*f)(A1,A2)const,A1 a1,A2 a2){
// typename Seq::iterator it=seq.begin();
// while(it!=seq.end()) ((*it++)->*f)(a1,a2);
//}
//template<class Seq,class T,class R>
//void apply(Seq& sq,R(T::*f)()){//通过指向对象的指针,访问对象的成员函数
// typename Seq::iterator it=sq.begin();
// while (it!=sq.end())
// {
// ((*it++)->*f)();
// }
//}
//template<class Seq,class T,class R,class A>
//void apply(Seq& sq,R(T::*f)(A),A a){
// typename Seq::iterator it=sq.begin();
// while(it!=sq.end()) ((*it)->*f)();
//}
//template<class Seq,class T,class R,class A1,class A2>
//void apply(Seq &seq,R(T::*f)(A1,A2),A1 a1,A2 a2){
// typename seq::iterator it=seq.begin();
// while(it!=seq.end()) ((*it++)->*f)(a1,a2);
//}