2222
2323#include " react/common/ptrcache.h"
2424
25+ /* ****************************************/ REACT_BEGIN /* ****************************************/
26+ template <typename > class Event ;
27+ /* *****************************************/ REACT_END /* *****************************************/
28+ /* **************************************/ REACT_IMPL_BEGIN /* *************************************/
29+ template <typename E>
30+ Event<E> SameGroupOrLink (const Group& targetGroup, const Event<E>& dep);
31+ /* ***************************************/ REACT_IMPL_END /* **************************************/
32+
2533/* ****************************************/ REACT_BEGIN /* ****************************************/
2634
2735// /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -60,10 +68,10 @@ class Event : protected REACT_IMPL::EventInternals<E>
6068 Event& operator =(Event&&) = default ;
6169
6270 auto GetGroup () const -> const Group&
63- { return GetNodePtr ()->GetGroup (); }
71+ { return this -> GetNodePtr ()->GetGroup (); }
6472
6573 auto GetGroup () -> Group&
66- { return GetNodePtr ()->GetGroup (); }
74+ { return this -> GetNodePtr ()->GetGroup (); }
6775
6876 friend bool operator ==(const Event<E>& a, const Event<E>& b)
6977 { return a.GetNodePtr () == b.GetNodePtr (); }
@@ -83,7 +91,7 @@ class Event : protected REACT_IMPL::EventInternals<E>
8391 { }
8492
8593 template <typename F, typename T>
86- static auto CreateProcessingNode (const Group& group, F&& func, const Event<T>& dep) -> decltype( auto )
94+ static auto CreateProcessingNode (const Group& group, F&& func, const Event<T>& dep) -> std::shared_ptr<REACT_IMPL::EventNode<E>>
8795 {
8896 using REACT_IMPL::EventProcessingNode;
8997 using REACT_IMPL::SameGroupOrLink;
@@ -103,7 +111,7 @@ class Event : protected REACT_IMPL::EventInternals<E>
103111 }
104112
105113 template <typename RET, typename NODE, typename ... ARGS>
106- friend static RET impl::CreateWrappedNode (ARGS&& ... args);
114+ friend RET impl::CreateWrappedNode (ARGS&& ... args);
107115};
108116
109117// /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -124,14 +132,14 @@ class EventSource : public Event<E>
124132
125133 EventSource (EventSource&& other) = default ;
126134 EventSource& operator =(EventSource&& other) = default ;
127-
135+
128136 void Emit (const E& value)
129137 { EmitValue (value); }
130138
131139 void Emit (E&& value)
132140 { EmitValue (std::move (value)); }
133141
134- template <typename T = E, typename = std::enable_if_t <std::is_same_v <T, Token>>>
142+ template <typename T = E, typename = std::enable_if_t <std::is_same <T, Token>::value >>
135143 void Emit ()
136144 { EmitValue (Token::value); }
137145
@@ -147,7 +155,7 @@ class EventSource : public Event<E>
147155 { }
148156
149157private:
150- static auto CreateSourceNode (const Group& group) -> decltype( auto )
158+ static auto CreateSourceNode (const Group& group) -> std::shared_ptr<REACT_IMPL::EventNode<E>>
151159 {
152160 using REACT_IMPL::EventSourceNode;
153161 return std::make_shared<EventSourceNode<E>>(group);
@@ -219,7 +227,7 @@ class EventSlot : public Event<E>
219227 NodeId nodeId = castedPtr->GetInputNodeId ();
220228 auto & graphPtr = GetInternals (this ->GetGroup ()).GetGraphPtr ();
221229
222- graphPtr->PushInput (nodeId, [this , castedPtr, &input] { castedPtr->AddSlotInput (SameGroupOrLink (GetGroup (), input)); });
230+ graphPtr->PushInput (nodeId, [this , castedPtr, &input] { castedPtr->AddSlotInput (SameGroupOrLink (this -> GetGroup (), input)); });
223231 }
224232
225233 void RemoveSlotInput (const Event<E>& input)
@@ -232,7 +240,7 @@ class EventSlot : public Event<E>
232240 NodeId nodeId = castedPtr->GetInputNodeId ();
233241 auto & graphPtr = GetInternals (this ->GetGroup ()).GetGraphPtr ();
234242
235- graphPtr->PushInput (nodeId, [this , castedPtr, &input] { castedPtr->RemoveSlotInput (SameGroupOrLink (GetGroup (), input)); });
243+ graphPtr->PushInput (nodeId, [this , castedPtr, &input] { castedPtr->RemoveSlotInput (SameGroupOrLink (this -> GetGroup (), input)); });
236244 }
237245
238246 void RemoveAllSlotInputs ()
@@ -274,12 +282,12 @@ class EventLink : public Event<E>
274282 { }
275283
276284private:
277- static auto GetOrCreateLinkNode (const Group& group, const Event<E>& input) -> decltype( auto )
285+ static auto GetOrCreateLinkNode (const Group& group, const Event<E>& input) -> std::shared_ptr<REACT_IMPL::EventNode<E>>
278286 {
279287 using REACT_IMPL::EventLinkNode;
280288 using REACT_IMPL::IReactNode;
281289 using REACT_IMPL::ReactGraph;
282-
290+
283291 IReactNode* k = GetInternals (input).GetNodePtr ().get ();
284292
285293 ReactGraph::LinkCache& linkCache = GetInternals (group).GetGraphPtr ()->GetLinkCache ();
@@ -403,7 +411,7 @@ static auto Join(const Event<U1>& dep1, const Event<Us>& ... deps) -> Event<std:
403411/* **************************************/ REACT_IMPL_BEGIN /* *************************************/
404412
405413template <typename E>
406- static Event<E> SameGroupOrLink (const Group& targetGroup, const Event<E>& dep)
414+ Event<E> SameGroupOrLink (const Group& targetGroup, const Event<E>& dep)
407415{
408416 if (dep.GetGroup () == targetGroup)
409417 return dep;
@@ -413,4 +421,4 @@ static Event<E> SameGroupOrLink(const Group& targetGroup, const Event<E>& dep)
413421
414422/* ***************************************/ REACT_IMPL_END /* **************************************/
415423
416- #endif // REACT_EVENT_H_INCLUDED
424+ #endif // REACT_EVENT_H_INCLUDED
0 commit comments