Skip to content

Commit b8fb492

Browse files
committed
Fixed some compile issues with ICC. To workaround the compiler bug described in http://software.intel.com/en-us/forums/topic/501502 the order of FunctionNode ctor args had to be changed.
1 parent 03054b8 commit b8fb492

5 files changed

Lines changed: 46 additions & 39 deletions

File tree

include/react/EventStream.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,6 @@ class REventSource : public REvents<D,E>
129129
}
130130
};
131131

132-
////////////////////////////////////////////////////////////////////////////////////////
133-
/// IsEventT
134-
////////////////////////////////////////////////////////////////////////////////////////
135-
template <typename D, typename T>
136-
struct IsEventT { static const bool value = false; };
137-
138-
template <typename D, typename T>
139-
struct IsEventT<D, REvents<D,T>> { static const bool value = true; };
140-
141-
template <typename D, typename T>
142-
struct IsEventT<D, REventSource<D,T>> { static const bool value = true; };
143-
144132
////////////////////////////////////////////////////////////////////////////////////////
145133
/// MakeEventSource
146134
////////////////////////////////////////////////////////////////////////////////////////

include/react/ReactiveDomain.h

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ template
5353
inline auto MakeSignal(TFunc func, const RSignal<D,TArgs>& ... args)
5454
-> RSignal<D,decltype(func(args() ...))>;
5555

56+
////////////////////////////////////////////////////////////////////////////////////////
57+
/// IsSignalT
58+
////////////////////////////////////////////////////////////////////////////////////////
59+
template <typename D, typename T>
60+
struct IsSignalT { static const bool value = false; };
61+
62+
template <typename D, typename T>
63+
struct IsSignalT<D, RSignal<D,T>> { static const bool value = true; };
64+
65+
template <typename D, typename T>
66+
struct IsSignalT<D, RVarSignal<D,T>> { static const bool value = true; };
67+
68+
////////////////////////////////////////////////////////////////////////////////////////
69+
/// IsEventT
70+
////////////////////////////////////////////////////////////////////////////////////////
71+
template <typename D, typename T>
72+
struct IsEventT { static const bool value = false; };
73+
74+
template <typename D, typename T>
75+
struct IsEventT<D, REvents<D,T>> { static const bool value = true; };
76+
77+
template <typename D, typename T>
78+
struct IsEventT<D, REventSource<D,T>> { static const bool value = true; };
79+
5680
/************************************/ REACT_END /*************************************/
5781

5882
/*********************************/ REACT_IMPL_BEGIN /*********************************/
@@ -449,9 +473,9 @@ class DomainBase
449473
static void Reset() { static_assert(false, "Reset option not implemented."); }
450474

451475
template <> static void Set<ETurnFlags>(uint v) { turnFlags_ |= v; }
452-
template <> static bool IsSet<ETurnFlags>(uint v) { return (turnFlags_ & v) != 0 }
453-
template <> static void Unset<ETurnFlags>(uint v) { turnFlags_ &= ~v;}
454-
template <> static void Reset<ETurnFlags>() { turnFlags_ = 0;}
476+
template <> static bool IsSet<ETurnFlags>(uint v) { return (turnFlags_ & v) != 0; }
477+
template <> static void Unset<ETurnFlags>(uint v) { turnFlags_ &= ~v; }
478+
template <> static void Reset<ETurnFlags>() { turnFlags_ = 0; }
455479

456480
private:
457481

include/react/ReactiveObject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include "react/Defs.h"
1010

11+
#include "ReactiveDomain.h"
12+
1113
/***********************************/ REACT_BEGIN /************************************/
1214

1315
////////////////////////////////////////////////////////////////////////////////////////

include/react/Signal.h

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,6 @@ bool Equals(const RVarSignal<D,L>& lhs, const RVarSignal<D,R>& rhs)
153153

154154
/***********************************/ REACT_BEGIN /************************************/
155155

156-
////////////////////////////////////////////////////////////////////////////////////////
157-
/// IsSignalT
158-
////////////////////////////////////////////////////////////////////////////////////////
159-
template <typename D, typename T>
160-
struct IsSignalT { static const bool value = false; };
161-
162-
template <typename D, typename T>
163-
struct IsSignalT<D, RSignal<D,T>> { static const bool value = true; };
164-
165-
template <typename D, typename T>
166-
struct IsSignalT<D, RVarSignal<D,T>> { static const bool value = true; };
167-
168156
////////////////////////////////////////////////////////////////////////////////////////
169157
/// MakeVar
170158
////////////////////////////////////////////////////////////////////////////////////////
@@ -240,7 +228,7 @@ inline auto MakeSignal(TFunc func, const RSignal<D,TArgs>& ... args)
240228

241229
return RSignal<D,S>(
242230
std::make_shared<REACT_IMPL::FunctionNode<D, S, TArgs ...>>(
243-
args.GetPtr() ..., func, false));
231+
func, args.GetPtr() ..., false));
244232
}
245233

246234
////////////////////////////////////////////////////////////////////////////////////////
@@ -260,7 +248,7 @@ inline auto operator ## op(const TSignal<D,TVal>& arg) \
260248
{ \
261249
return RSignal<D,TVal>( \
262250
std::make_shared<REACT_IMPL::FunctionNode<D,TVal,TVal>>( \
263-
arg.GetPtr(), [] (TVal a) { return op a; }, false)); \
251+
[] (TVal a) { return op a; }, arg.GetPtr(), false)); \
264252
}
265253

266254
DECLARE_OP(+);
@@ -290,8 +278,8 @@ inline auto operator ## op(const TLeftSignal<D,TLeftVal>& lhs, \
290278
{ \
291279
return RSignal<D,TLeftVal>( \
292280
std::make_shared<REACT_IMPL::FunctionNode<D,TLeftVal,TLeftVal,TRightVal>>( \
293-
lhs.GetPtr(), rhs.GetPtr(), [] (const TLeftVal& a, const TRightVal& b) { \
294-
return a op b; }, false)); \
281+
[] (const TLeftVal& a, const TRightVal& b) { return a op b; }, \
282+
lhs.GetPtr(), rhs.GetPtr(), false)); \
295283
} \
296284
\
297285
template \
@@ -311,7 +299,7 @@ inline auto operator ## op(const TLeftSignal<D,TLeftVal>& lhs, \
311299
{ \
312300
return RSignal<D,TLeftVal>( \
313301
std::make_shared<REACT_IMPL::FunctionNode<D,TLeftVal,TLeftVal>>( \
314-
lhs.GetPtr(), [=] (const TLeftVal& a) { return a op rhs; }, false)); \
302+
[=] (const TLeftVal& a) { return a op rhs; }, lhs.GetPtr(), false)); \
315303
} \
316304
\
317305
template \
@@ -331,7 +319,7 @@ inline auto operator ## op(const TLeftVal& lhs, \
331319
{ \
332320
return RSignal<D,TRightVal>( \
333321
std::make_shared<REACT_IMPL::FunctionNode<D,TRightVal,TRightVal>>( \
334-
rhs.GetPtr(), [=] (const TRightVal& a) { return lhs op a; }, false)); \
322+
[=] (const TRightVal& a) { return lhs op a; }, rhs.GetPtr(), false)); \
335323
}
336324

337325
DECLARE_OP(+);
@@ -386,7 +374,8 @@ inline auto operator ## op(const TLeftSignal<D,TLeftVal>& lhs, \
386374
{ \
387375
return RSignal<D,bool>( \
388376
std::make_shared<REACT_IMPL::FunctionNode<D,bool,TLeftVal,TRightVal>>( \
389-
lhs.GetPtr(), rhs.GetPtr(), [] (TLeftVal a, TRightVal b) { return a op b; }, false)); \
377+
[] (const TLeftVal& a, const TRightVal& b) { return a op b; }, \
378+
lhs.GetPtr(), rhs.GetPtr(), false)); \
390379
} \
391380
\
392381
template \
@@ -405,7 +394,7 @@ inline auto operator ## op(const TLeftSignal<D,TLeftVal>& lhs, const TRightVal&
405394
{ \
406395
return RSignal<D,bool>( \
407396
std::make_shared<REACT_IMPL::FunctionNode<D,bool,TLeftVal>>( \
408-
lhs.GetPtr(), [=] (TLeftVal a) { return a op rhs; }, false)); \
397+
[=] (const TLeftVal& a) { return a op rhs; }, lhs.GetPtr(), false)); \
409398
}
410399

411400
DECLARE_OP(==);
@@ -431,7 +420,7 @@ inline auto operator ## op(const RSignal<D,TVal>& arg) \
431420
{ \
432421
return RSignal<D,TVal>( \
433422
std::make_shared<REACT_IMPL::FunctionNode<D,bool,TVal>>( \
434-
arg.GetPtr(), [] (TVal a) { return op a; }, false)); \
423+
[] (const TVal& a) { return op a; }, arg.GetPtr(), false)); \
435424
}
436425

437426
DECLARE_OP(!);
@@ -454,7 +443,8 @@ inline auto operator ## op(const RSignal<D,TLeftVal>& lhs, \
454443
{ \
455444
return RSignal<D,bool>( \
456445
std::make_shared<REACT_IMPL::FunctionNode<D,bool,TLeftVal,TRightVal>>( \
457-
lhs.GetPtr(), rhs.GetPtr(), [] (TLeftVal a, TRightVal b) { return a op b; }, false)); \
446+
[] (const TLeftVal& a, const TRightVal& b) { return a op b; }, \
447+
lhs.GetPtr(), rhs.GetPtr(), false)); \
458448
} \
459449
\
460450
template \
@@ -468,7 +458,7 @@ inline auto operator ## op(const RSignal<D,TLeftVal>& lhs, const TRightVal& rhs)
468458
{ \
469459
return RSignal<D,bool>( \
470460
std::make_shared<REACT_IMPL::FunctionNode<D,bool,TLeftVal>>( \
471-
lhs.GetPtr(), [=] (TLeftVal a) { return a op rhs; }, false)); \
461+
[=] (TLeftVal a) { return a op rhs; }, lhs.GetPtr(), false)); \
472462
}
473463

474464
DECLARE_OP(&&);

include/react/graph/SignalNodes.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
/*********************************/ REACT_IMPL_BEGIN /*********************************/
1919

20+
template <typename D, typename L, typename R>
21+
bool Equals(const L& lhs, const R& rhs);
22+
2023
////////////////////////////////////////////////////////////////////////////////////////
2124
/// SignalNode
2225
////////////////////////////////////////////////////////////////////////////////////////
@@ -194,7 +197,7 @@ class FunctionNode : public SignalNode<D,S>
194197
{
195198
public:
196199
template <typename F>
197-
FunctionNode(const SignalNodePtr<D,TArgs>& ... args, F&& func, bool registered) :
200+
FunctionNode(F&& func, const SignalNodePtr<D,TArgs>& ... args, bool registered) :
198201
SignalNode<D, S>(true),
199202
deps_{ make_tuple(args ...) },
200203
func_{ std::forward<F>(func) }

0 commit comments

Comments
 (0)