diff options
Diffstat (limited to '')
-rw-r--r-- | src/tests/signal.cpp | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/src/tests/signal.cpp b/src/tests/signal.cpp index 8920461..93519fa 100644 --- a/src/tests/signal.cpp +++ b/src/tests/signal.cpp | |||
@@ -17,56 +17,16 @@ void PrintFancy( const Bu::String &s ) | |||
17 | 17 | ||
18 | int Square( int a ) | 18 | int Square( int a ) |
19 | { | 19 | { |
20 | println("Square called"); | ||
20 | return a*a; | 21 | return a*a; |
21 | } | 22 | } |
22 | 23 | ||
23 | int Double( int a ) | 24 | int Double( int a ) |
24 | { | 25 | { |
26 | println("Double called"); | ||
25 | return a+a; | 27 | return a+a; |
26 | } | 28 | } |
27 | 29 | ||
28 | template<typename R, typename P> | ||
29 | class SignalList1 : public Bu::List<Bu::Signal1<R,P> > | ||
30 | { | ||
31 | typedef Bu::List<Bu::Signal1<R,P> > MyType; | ||
32 | public: | ||
33 | SignalList1() | ||
34 | { | ||
35 | } | ||
36 | |||
37 | using MyType::iterator; | ||
38 | using MyType::const_iterator; | ||
39 | |||
40 | R operator()( P p1 ) | ||
41 | { | ||
42 | println("===Non-void um...non-specialization==="); | ||
43 | R tmp; | ||
44 | for( typename MyType::iterator i = MyType::begin(); i; i++ ) | ||
45 | tmp = (*i)( p1 ); | ||
46 | return tmp; | ||
47 | } | ||
48 | }; | ||
49 | |||
50 | template<typename P> | ||
51 | class SignalList1<void, P> : public Bu::List<Bu::Signal1<void,P> > | ||
52 | { | ||
53 | typedef Bu::List<Bu::Signal1<void,P> > MyType; | ||
54 | public: | ||
55 | SignalList1() | ||
56 | { | ||
57 | } | ||
58 | |||
59 | using MyType::iterator; | ||
60 | using MyType::const_iterator; | ||
61 | |||
62 | void operator()( P p1 ) | ||
63 | { | ||
64 | println("===Void specialization==="); | ||
65 | for( typename MyType::iterator i = MyType::begin(); i; i++ ) | ||
66 | (*i)( p1 ); | ||
67 | } | ||
68 | }; | ||
69 | |||
70 | int main() | 30 | int main() |
71 | { | 31 | { |
72 | SignalList1<void,const Bu::String &> lPrints; | 32 | SignalList1<void,const Bu::String &> lPrints; |