Skip to content

Commit 61351b6

Browse files
committed
Lots of refactoring to support gcc 4.8.2 and clang 3.4.
sandbox compiles so far, tests and benchmarks still need more work.
1 parent 5b96e23 commit 61351b6

46 files changed

Lines changed: 1629 additions & 1219 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/react/Algorithm.h

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#ifndef REACT_ALGORITHM_H_INCLUDED
8+
#define REACT_ALGORITHM_H_INCLUDED
9+
710
#pragma once
811

912
#include "react/detail/Defs.h"
@@ -45,17 +48,18 @@ template
4548
typename E,
4649
typename V,
4750
typename FIn,
48-
typename S = std::decay<V>::type
51+
typename S = typename std::decay<V>::type
4952
>
5053
auto Iterate(const Events<D,E>& events, V&& init, FIn&& func)
5154
-> Signal<D,S>
5255
{
5356
using REACT_IMPL::IterateNode;
5457
using REACT_IMPL::IterateByRefNode;
5558

56-
using F = std::decay<FIn>::type;
57-
using TNode = std::conditional<
58-
std::is_same<void,std::result_of<F(E,S)>::type>::value,
59+
using F = typename std::decay<FIn>::type;
60+
using TNode = typename std::conditional<
61+
std::is_same<void,
62+
typename std::result_of<F(E,S)>::type>::value,
5963
IterateByRefNode<D,S,E,F>,
6064
IterateNode<D,S,E,F>
6165
>::type;
@@ -75,7 +79,7 @@ template
7579
typename V,
7680
typename FIn,
7781
typename ... TDepValues,
78-
typename S = std::decay<V>::type
82+
typename S = typename std::decay<V>::type
7983
>
8084
auto Iterate(const Events<D,E>& events, V&& init,
8185
const SignalPack<D,TDepValues...>& depPack, FIn&& func)
@@ -84,9 +88,10 @@ auto Iterate(const Events<D,E>& events, V&& init,
8488
using REACT_IMPL::SyncedIterateNode;
8589
using REACT_IMPL::SyncedIterateByRefNode;
8690

87-
using F = std::decay<FIn>::type;
88-
using TNode = std::conditional<
89-
std::is_same<void,std::result_of<F(E,S,TDepValues...)>::type>::value,
91+
using F = typename std::decay<FIn>::type;
92+
using TNode = typename std::conditional<
93+
std::is_same<void,
94+
typename std::result_of<F(E,S,TDepValues...)>::type>::value,
9095
SyncedIterateByRefNode<D,S,E,F,TDepValues ...>,
9196
SyncedIterateNode<D,S,E,F,TDepValues ...>
9297
>::type;
@@ -125,7 +130,7 @@ template
125130
<
126131
typename D,
127132
typename V,
128-
typename T = std::decay<V>::type
133+
typename T = typename std::decay<V>::type
129134
>
130135
auto Hold(const Events<D,T>& events, V&& init)
131136
-> Signal<D,T>
@@ -214,7 +219,7 @@ template
214219
<
215220
typename D,
216221
typename V,
217-
typename S = std::decay<V>::type
222+
typename S = typename std::decay<V>::type
218223
>
219224
auto OnChangedTo(const Signal<D,S>& target, V&& value)
220225
-> Events<D,Token>
@@ -225,3 +230,5 @@ auto OnChangedTo(const Signal<D,S>& target, V&& value)
225230
}
226231

227232
/******************************************/ REACT_END /******************************************/
233+
234+
#endif // REACT_ALGORITHM_H_INCLUDED

include/react/Domain.h

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#ifndef REACT_DOMAIN_H_INCLUDED
8+
#define REACT_DOMAIN_H_INCLUDED
9+
710
#pragma once
811

912
#include "react/detail/Defs.h"
1013

14+
#include <utility>
15+
#include <type_traits>
16+
1117
#include "react/TypeTraits.h"
18+
19+
#include "react/detail/EventFwd.h"
20+
#include "react/detail/SignalFwd.h"
21+
1222
#include "react/detail/ReactiveInput.h"
1323
#include "react/detail/Options.h"
1424

@@ -34,26 +44,6 @@ class Observer;
3444
template <typename D>
3545
class ScopedObserver;
3646

37-
template <typename D, typename S>
38-
class Signal;
39-
40-
template <typename D, typename S>
41-
class VarSignal;
42-
43-
template <typename D, typename S, typename TOp>
44-
class TempSignal;
45-
46-
template <typename D, typename E>
47-
class Events;
48-
49-
template <typename D, typename E>
50-
class EventSource;
51-
52-
template <typename D, typename E, typename TOp>
53-
class TempEvents;
54-
55-
enum class Token;
56-
5747
using REACT_IMPL::TurnFlagsT;
5848

5949
#ifdef REACT_ENABLE_LOGGING
@@ -113,8 +103,8 @@ class DomainBase
113103
template
114104
<
115105
typename V,
116-
typename S = std::decay<V>::type,
117-
class = std::enable_if<
106+
typename S = typename std::decay<V>::type,
107+
class = typename std::enable_if<
118108
!IsSignal<S>::value>::type
119109
>
120110
static auto MakeVar(V&& value)
@@ -129,9 +119,9 @@ class DomainBase
129119
template
130120
<
131121
typename V,
132-
typename S = std::decay<V>::type,
133-
typename TInner = S::ValueT,
134-
class = std::enable_if<
122+
typename S = typename std::decay<V>::type,
123+
typename TInner = typename S::ValueT,
124+
class = typename std::enable_if<
135125
IsSignal<S>::value>::type
136126
>
137127
static auto MakeVar(V&& value)
@@ -212,7 +202,7 @@ class DomainInitializer
212202
D::Log();
213203
#endif //REACT_ENABLE_LOGGING
214204

215-
typename D::Engine::Engine();
205+
D::Engine::Engine();
216206
}
217207
};
218208

@@ -223,4 +213,6 @@ class DomainInitializer
223213
///////////////////////////////////////////////////////////////////////////////////////////////////
224214
#define REACTIVE_DOMAIN(name, ...) \
225215
struct name : public REACT::DomainBase<name, REACT_IMPL::DomainPolicy<__VA_ARGS__ >> {}; \
226-
REACT_IMPL::DomainInitializer< name > name ## _initializer_;
216+
REACT_IMPL::DomainInitializer< name > name ## _initializer_;
217+
218+
#endif // REACT_DOMAIN_H_INCLUDED

0 commit comments

Comments
 (0)