summaryrefslogtreecommitdiff
path: root/Rx/v2
diff options
context:
space:
mode:
authorBenPope <ben@pope.name>2015-02-18 00:48:16 +0800
committerKirk Shoop <kirk.shoop@microsoft.com>2015-02-17 21:18:27 -0800
commit14b0164c5a6ecda8777476f6c27af3bbab1ebd33 (patch)
treebf419ef72874fac256f6c53e27a970782ff412dc /Rx/v2
parent2e8e8903d6e33f7447313fccf98883f9991b83ce (diff)
downloadRxCpp-14b0164c5a6ecda8777476f6c27af3bbab1ebd33.tar.gz
Use type aliases or: How I learned to love the closing chevron
Diffstat (limited to 'Rx/v2')
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-concat.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-concat_map.hpp22
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-distinct_until_changed.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-filter.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-finally.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-flat_map.hpp22
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-group_by.hpp20
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-lift.hpp14
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-map.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-merge.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-multicast.hpp10
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-observe_on.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-pairwise.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-publish.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-reduce.hpp30
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-ref_count.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-repeat.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-retry.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-scan.hpp18
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-skip.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-skip_until.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-start_with.hpp4
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-subscribe.hpp4
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-take.hpp12
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-take_until.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window.hpp8
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window_time.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp16
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-zip.hpp16
-rw-r--r--Rx/v2/src/rxcpp/rx-connectable_observable.hpp4
-rw-r--r--Rx/v2/src/rxcpp/rx-coordination.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-grouped_observable.hpp10
-rw-r--r--Rx/v2/src/rxcpp/rx-notification.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp74
-rw-r--r--Rx/v2/src/rxcpp/rx-observer.hpp16
-rw-r--r--Rx/v2/src/rxcpp/rx-operators.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-predef.hpp24
-rw-r--r--Rx/v2/src/rxcpp/rx-scheduler.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-sources.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-subscriber.hpp2
-rw-r--r--Rx/v2/src/rxcpp/rx-subscription.hpp8
-rw-r--r--Rx/v2/src/rxcpp/rx-util.hpp9
-rw-r--r--Rx/v2/src/rxcpp/schedulers/rx-test.hpp8
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-create.hpp2
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-defer.hpp10
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-error.hpp10
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-interval.hpp2
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-iterate.hpp22
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-range.hpp2
-rw-r--r--Rx/v2/src/rxcpp/sources/rx-scope.hpp12
-rw-r--r--Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp2
58 files changed, 357 insertions, 354 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp b/Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp
index 56507d4..b729311 100644
--- a/Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp
@@ -17,7 +17,7 @@ namespace detail {
template<class T>
struct buffer_count
{
- typedef typename std::decay<T>::type source_value_type;
+ typedef rxu::decay_t<T> source_value_type;
struct buffer_count_values
{
buffer_count_values(int c, int s)
@@ -41,7 +41,7 @@ struct buffer_count
{
typedef buffer_count_observer<Subscriber> this_type;
typedef std::vector<T> value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
dest_type dest;
mutable int cursor;
@@ -105,8 +105,8 @@ public:
buffer_count_factory(int c, int s) : count(c), skip(s) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_count<typename std::decay<Observable>::type::value_type>(count, skip))) {
- return source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_count<typename std::decay<Observable>::type::value_type>(count, skip));
+ -> decltype(source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_count<rxu::value_type_t<rxu::decay_t<Observable>>>(count, skip))) {
+ return source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_count<rxu::value_type_t<rxu::decay_t<Observable>>>(count, skip));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp b/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
index dac1302..5948347 100644
--- a/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp
@@ -19,10 +19,10 @@ struct buffer_with_time
static_assert(std::is_convertible<Duration, rxsc::scheduler::clock_type::duration>::value, "Duration parameter must convert to rxsc::scheduler::clock_type::duration");
static_assert(is_coordination<Coordination>::value, "Coordination parameter must satisfy the requirements for a Coordination");
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
- typedef typename std::decay<Duration>::type duration_type;
+ typedef rxu::decay_t<Duration> duration_type;
struct buffer_with_time_values
{
@@ -48,7 +48,7 @@ struct buffer_with_time
{
typedef buffer_with_time_observer<Subscriber> this_type;
typedef std::vector<T> value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
struct buffer_with_time_subscriber_values : public buffer_with_time_values
@@ -131,8 +131,8 @@ struct buffer_with_time
template<class Duration, class Coordination>
class buffer_with_time_factory
{
- typedef typename std::decay<Duration>::type duration_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Duration> duration_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
duration_type period;
duration_type skip;
@@ -141,8 +141,8 @@ public:
buffer_with_time_factory(duration_type p, duration_type s, coordination_type c) : period(p), skip(s), coordination(c) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_with_time<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination))) {
- return source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_with_time<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination));
+ -> decltype(source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_with_time<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination))) {
+ return source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_with_time<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp b/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
index ea4d608..87b6c2a 100644
--- a/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp
@@ -19,10 +19,10 @@ struct buffer_with_time_or_count
static_assert(std::is_convertible<Duration, rxsc::scheduler::clock_type::duration>::value, "Duration parameter must convert to rxsc::scheduler::clock_type::duration");
static_assert(is_coordination<Coordination>::value, "Coordination parameter must satisfy the requirements for a Coordination");
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
- typedef typename std::decay<Duration>::type duration_type;
+ typedef rxu::decay_t<Duration> duration_type;
struct buffer_with_time_or_count_values
{
@@ -48,7 +48,7 @@ struct buffer_with_time_or_count
{
typedef buffer_with_time_or_count_observer<Subscriber> this_type;
typedef std::vector<T> value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
struct buffer_with_time_or_count_subscriber_values : public buffer_with_time_or_count_values
@@ -127,8 +127,8 @@ struct buffer_with_time_or_count
template<class Duration, class Coordination>
class buffer_with_time_or_count_factory
{
- typedef typename std::decay<Duration>::type duration_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Duration> duration_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
duration_type period;
duration_type skip;
@@ -137,8 +137,8 @@ public:
buffer_with_time_or_count_factory(duration_type p, duration_type s, coordination_type c) : period(p), skip(s), coordination(c) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_with_time_or_count<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination))) {
- return source.template lift<std::vector<typename std::decay<Observable>::type::value_type>>(buffer_with_time_or_count<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination));
+ -> decltype(source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_with_time_or_count<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination))) {
+ return source.template lift<std::vector<rxu::value_type_t<rxu::decay_t<Observable>>>>(buffer_with_time_or_count<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp b/Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp
index 3128217..3513dd0 100644
--- a/Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp
@@ -19,8 +19,8 @@ struct combine_latest_traits {
typedef std::tuple<ObservableN...> tuple_source_type;
typedef std::tuple<rxu::detail::maybe<typename ObservableN::value_type>...> tuple_source_value_type;
- typedef typename std::decay<Selector>::type selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Selector> selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
struct tag_not_valid {};
template<class CS, class... CVN>
@@ -34,7 +34,7 @@ struct combine_latest_traits {
};
template<class Coordination, class Selector, class... ObservableN>
-struct combine_latest : public operator_base<typename combine_latest_traits<Coordination, Selector, ObservableN...>::value_type>
+struct combine_latest : public operator_base<rxu::value_type_t<combine_latest_traits<Coordination, Selector, ObservableN...>>>
{
typedef combine_latest<Coordination, Selector, ObservableN...> this_type;
@@ -179,8 +179,8 @@ struct combine_latest : public operator_base<typename combine_latest_traits<Coor
template<class Coordination, class Selector, class... ObservableN>
class combine_latest_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
- typedef typename std::decay<Selector>::type selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
+ typedef rxu::decay_t<Selector> selector_type;
typedef std::tuple<ObservableN...> tuple_source_type;
coordination_type coordination;
@@ -189,9 +189,9 @@ class combine_latest_factory
template<class... YObservableN>
auto make(std::tuple<YObservableN...> source)
- -> observable<typename combine_latest<Coordination, Selector, YObservableN...>::value_type, combine_latest<Coordination, Selector, YObservableN...>> {
- return observable<typename combine_latest<Coordination, Selector, YObservableN...>::value_type, combine_latest<Coordination, Selector, YObservableN...>>(
- combine_latest<Coordination, Selector, YObservableN...>(coordination, selector, std::move(source)));
+ -> observable<rxu::value_type_t<combine_latest<Coordination, Selector, YObservableN...>>, combine_latest<Coordination, Selector, YObservableN...>> {
+ return observable<rxu::value_type_t<combine_latest<Coordination, Selector, YObservableN...>>, combine_latest<Coordination, Selector, YObservableN...>>(
+ combine_latest<Coordination, Selector, YObservableN...>(coordination, selector, std::move(source)));
}
public:
combine_latest_factory(coordination_type sf, selector_type s, ObservableN... on)
diff --git a/Rx/v2/src/rxcpp/operators/rx-concat.hpp b/Rx/v2/src/rxcpp/operators/rx-concat.hpp
index 2afe974..01f023d 100644
--- a/Rx/v2/src/rxcpp/operators/rx-concat.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-concat.hpp
@@ -15,13 +15,13 @@ namespace detail {
template<class T, class Observable, class Coordination>
struct concat
- : public operator_base<typename std::decay<T>::type::value_type>
+ : public operator_base<rxu::value_type_t<rxu::decay_t<T>>>
{
typedef concat<T, Observable, Coordination> this_type;
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
@@ -184,7 +184,7 @@ struct concat
template<class Coordination>
class concat_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
coordination_type coordination;
public:
@@ -195,9 +195,9 @@ public:
template<class Observable>
auto operator()(Observable source)
- -> observable<typename concat<typename Observable::value_type, Observable, Coordination>::value_type, concat<typename Observable::value_type, Observable, Coordination>> {
- return observable<typename concat<typename Observable::value_type, Observable, Coordination>::value_type, concat<typename Observable::value_type, Observable, Coordination>>(
- concat<typename Observable::value_type, Observable, Coordination>(std::move(source), coordination));
+ -> observable<rxu::value_type_t<concat<rxu::value_type_t<Observable>, Observable, Coordination>>, concat<rxu::value_type_t<Observable>, Observable, Coordination>> {
+ return observable<rxu::value_type_t<concat<rxu::value_type_t<Observable>, Observable, Coordination>>, concat<rxu::value_type_t<Observable>, Observable, Coordination>>(
+ concat<rxu::value_type_t<Observable>, Observable, Coordination>(std::move(source), coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-concat_map.hpp b/Rx/v2/src/rxcpp/operators/rx-concat_map.hpp
index e5ea951..72280e8 100644
--- a/Rx/v2/src/rxcpp/operators/rx-concat_map.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-concat_map.hpp
@@ -15,10 +15,10 @@ namespace detail {
template<class Observable, class CollectionSelector, class ResultSelector, class Coordination>
struct concat_traits {
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<CollectionSelector>::type collection_selector_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<CollectionSelector> collection_selector_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename source_type::value_type source_value_type;
@@ -50,7 +50,7 @@ struct concat_traits {
template<class Observable, class CollectionSelector, class ResultSelector, class Coordination>
struct concat_map
- : public operator_base<typename concat_traits<Observable, CollectionSelector, ResultSelector, Coordination>::value_type>
+ : public operator_base<rxu::value_type_t<concat_traits<Observable, CollectionSelector, ResultSelector, Coordination>>>
{
typedef concat_map<Observable, CollectionSelector, ResultSelector, Coordination> this_type;
typedef concat_traits<Observable, CollectionSelector, ResultSelector, Coordination> traits;
@@ -241,9 +241,9 @@ private:
template<class CollectionSelector, class ResultSelector, class Coordination>
class concat_map_factory
{
- typedef typename std::decay<CollectionSelector>::type collection_selector_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<CollectionSelector> collection_selector_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
collection_selector_type selectorCollection;
result_selector_type selectorResult;
@@ -258,9 +258,9 @@ public:
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename concat_map<Observable, CollectionSelector, ResultSelector, Coordination>::value_type, concat_map<Observable, CollectionSelector, ResultSelector, Coordination>> {
- return observable<typename concat_map<Observable, CollectionSelector, ResultSelector, Coordination>::value_type, concat_map<Observable, CollectionSelector, ResultSelector, Coordination>>(
- concat_map<Observable, CollectionSelector, ResultSelector, Coordination>(std::forward<Observable>(source), selectorCollection, selectorResult, coordination));
+ -> observable<rxu::value_type_t<concat_map<Observable, CollectionSelector, ResultSelector, Coordination>>, concat_map<Observable, CollectionSelector, ResultSelector, Coordination>> {
+ return observable<rxu::value_type_t<concat_map<Observable, CollectionSelector, ResultSelector, Coordination>>, concat_map<Observable, CollectionSelector, ResultSelector, Coordination>>(
+ concat_map<Observable, CollectionSelector, ResultSelector, Coordination>(std::forward<Observable>(source), selectorCollection, selectorResult, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp b/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp
index b38aa08..7713c2c 100644
--- a/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T, class ConnectableObservable>
struct connect_forever : public operator_base<T>
{
- typedef typename std::decay<ConnectableObservable>::type source_type;
+ typedef rxu::decay_t<ConnectableObservable> source_type;
source_type source;
@@ -38,9 +38,9 @@ public:
connect_forever_factory() {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, connect_forever<typename std::decay<Observable>::type::value_type, Observable>> {
- return observable<typename std::decay<Observable>::type::value_type, connect_forever<typename std::decay<Observable>::type::value_type, Observable>>(
- connect_forever<typename std::decay<Observable>::type::value_type, Observable>(std::forward<Observable>(source)));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, connect_forever<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, connect_forever<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>>(
+ connect_forever<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>(std::forward<Observable>(source)));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-distinct_until_changed.hpp b/Rx/v2/src/rxcpp/operators/rx-distinct_until_changed.hpp
index 910edda..d43c03f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-distinct_until_changed.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-distinct_until_changed.hpp
@@ -16,14 +16,14 @@ namespace detail {
template<class T>
struct distinct_until_changed
{
- typedef typename std::decay<T>::type source_value_type;
+ typedef rxu::decay_t<T> source_value_type;
template<class Subscriber>
struct distinct_until_changed_observer
{
typedef distinct_until_changed_observer<Subscriber> this_type;
typedef source_value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
dest_type dest;
mutable rxu::detail::maybe<source_value_type> remembered;
@@ -62,8 +62,8 @@ class distinct_until_changed_factory
public:
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename std::decay<Observable>::type::value_type>(distinct_until_changed<typename std::decay<Observable>::type>::value_type)) {
- return source.template lift<typename std::decay<Observable>::type::value_type>(distinct_until_changed<typename std::decay<Observable>::type>::value_type);
+ -> decltype(source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(distinct_until_changed<rxu::decay_t<Observable>>::value_type)) {
+ return source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(distinct_until_changed<rxu::decay_t<Observable>>::value_type);
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-filter.hpp b/Rx/v2/src/rxcpp/operators/rx-filter.hpp
index 775bc16..f5aba00 100644
--- a/Rx/v2/src/rxcpp/operators/rx-filter.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-filter.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Predicate>
struct filter
{
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Predicate>::type test_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Predicate> test_type;
test_type test;
filter(test_type t)
@@ -30,7 +30,7 @@ struct filter
{
typedef filter_observer<Subscriber> this_type;
typedef source_value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
dest_type dest;
test_type test;
@@ -73,14 +73,14 @@ struct filter
template<class Predicate>
class filter_factory
{
- typedef typename std::decay<Predicate>::type test_type;
+ typedef rxu::decay_t<Predicate> test_type;
test_type predicate;
public:
filter_factory(test_type p) : predicate(std::move(p)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename std::decay<Observable>::type::value_type>(filter<typename std::decay<Observable>::type::value_type, test_type>(predicate))) {
- return source.template lift<typename std::decay<Observable>::type::value_type>(filter<typename std::decay<Observable>::type::value_type, test_type>(predicate));
+ -> decltype(source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(filter<rxu::value_type_t<rxu::decay_t<Observable>>, test_type>(predicate))) {
+ return source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(filter<rxu::value_type_t<rxu::decay_t<Observable>>, test_type>(predicate));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-finally.hpp b/Rx/v2/src/rxcpp/operators/rx-finally.hpp
index 6e2b7ad..cd45d75 100644
--- a/Rx/v2/src/rxcpp/operators/rx-finally.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-finally.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class LastCall>
struct finally
{
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<LastCall>::type last_call_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<LastCall> last_call_type;
last_call_type last_call;
finally(last_call_type lc)
@@ -30,7 +30,7 @@ struct finally
{
typedef finally_observer<Subscriber> this_type;
typedef source_value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
dest_type dest;
@@ -70,14 +70,14 @@ struct finally
template<class LastCall>
class finally_factory
{
- typedef typename std::decay<LastCall>::type last_call_type;
+ typedef rxu::decay_t<LastCall> last_call_type;
last_call_type last_call;
public:
finally_factory(last_call_type lc) : last_call(std::move(lc)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename std::decay<Observable>::type::value_type>(filter<typename std::decay<Observable>::type::value_type, last_call_type>(last_call))) {
- return source.template lift<typename std::decay<Observable>::type::value_type>(filter<typename std::decay<Observable>::type::value_type, last_call_type>(last_call));
+ -> decltype(source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(filter<rxu::value_type_t<rxu::decay_t<Observable>>, last_call_type>(last_call))) {
+ return source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(filter<rxu::value_type_t<rxu::decay_t<Observable>>, last_call_type>(last_call));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-flat_map.hpp b/Rx/v2/src/rxcpp/operators/rx-flat_map.hpp
index f50ed43..afe6ae7 100644
--- a/Rx/v2/src/rxcpp/operators/rx-flat_map.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-flat_map.hpp
@@ -15,10 +15,10 @@ namespace detail {
template<class Observable, class CollectionSelector, class ResultSelector, class Coordination>
struct flat_map_traits {
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<CollectionSelector>::type collection_selector_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<CollectionSelector> collection_selector_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename source_type::value_type source_value_type;
@@ -48,7 +48,7 @@ struct flat_map_traits {
template<class Observable, class CollectionSelector, class ResultSelector, class Coordination>
struct flat_map
- : public operator_base<typename flat_map_traits<Observable, CollectionSelector, ResultSelector, Coordination>::value_type>
+ : public operator_base<rxu::value_type_t<flat_map_traits<Observable, CollectionSelector, ResultSelector, Coordination>>>
{
typedef flat_map<Observable, CollectionSelector, ResultSelector, Coordination> this_type;
typedef flat_map_traits<Observable, CollectionSelector, ResultSelector, Coordination> traits;
@@ -224,9 +224,9 @@ struct flat_map
template<class CollectionSelector, class ResultSelector, class Coordination>
class flat_map_factory
{
- typedef typename std::decay<CollectionSelector>::type collection_selector_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<CollectionSelector> collection_selector_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
collection_selector_type selectorCollection;
result_selector_type selectorResult;
@@ -241,9 +241,9 @@ public:
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename flat_map<Observable, CollectionSelector, ResultSelector, Coordination>::value_type, flat_map<Observable, CollectionSelector, ResultSelector, Coordination>> {
- return observable<typename flat_map<Observable, CollectionSelector, ResultSelector, Coordination>::value_type, flat_map<Observable, CollectionSelector, ResultSelector, Coordination>>(
- flat_map<Observable, CollectionSelector, ResultSelector, Coordination>(std::forward<Observable>(source), selectorCollection, selectorResult, coordination));
+ -> observable<rxu::value_type_t<flat_map<Observable, CollectionSelector, ResultSelector, Coordination>>, flat_map<Observable, CollectionSelector, ResultSelector, Coordination>> {
+ return observable<rxu::value_type_t<flat_map<Observable, CollectionSelector, ResultSelector, Coordination>>, flat_map<Observable, CollectionSelector, ResultSelector, Coordination>>(
+ flat_map<Observable, CollectionSelector, ResultSelector, Coordination>(std::forward<Observable>(source), selectorCollection, selectorResult, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-group_by.hpp b/Rx/v2/src/rxcpp/operators/rx-group_by.hpp
index 5ef609b..8afb4b9 100644
--- a/Rx/v2/src/rxcpp/operators/rx-group_by.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-group_by.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T, class Selector>
struct is_group_by_selector_for {
- typedef typename std::decay<Selector>::type selector_type;
+ typedef rxu::decay_t<Selector> selector_type;
typedef T source_value_type;
struct tag_not_valid {};
@@ -33,10 +33,10 @@ template<class T, class Observable, class KeySelector, class MarbleSelector, cla
struct group_by_traits
{
typedef T source_value_type;
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<KeySelector>::type key_selector_type;
- typedef typename std::decay<MarbleSelector>::type marble_selector_type;
- typedef typename std::decay<BinaryPredicate>::type predicate_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<KeySelector> key_selector_type;
+ typedef rxu::decay_t<MarbleSelector> marble_selector_type;
+ typedef rxu::decay_t<BinaryPredicate> predicate_type;
static_assert(is_group_by_selector_for<source_value_type, key_selector_type>::value, "group_by KeySelector must be a function with the signature key_type(source_value_type)");
@@ -110,7 +110,7 @@ struct group_by
{
typedef group_by_observer<Subscriber> this_type;
typedef typename traits_type::grouped_observable_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
dest_type dest;
@@ -174,9 +174,9 @@ struct group_by
template<class KeySelector, class MarbleSelector, class BinaryPredicate>
class group_by_factory
{
- typedef typename std::decay<KeySelector>::type key_selector_type;
- typedef typename std::decay<MarbleSelector>::type marble_selector_type;
- typedef typename std::decay<BinaryPredicate>::type predicate_type;
+ typedef rxu::decay_t<KeySelector> key_selector_type;
+ typedef rxu::decay_t<MarbleSelector> marble_selector_type;
+ typedef rxu::decay_t<BinaryPredicate> predicate_type;
key_selector_type keySelector;
marble_selector_type marbleSelector;
predicate_type predicate;
@@ -190,7 +190,7 @@ public:
template<class Observable>
struct group_by_factory_traits
{
- typedef typename Observable::value_type value_type;
+ typedef rxu::value_type_t<Observable> value_type;
typedef detail::group_by_traits<value_type, Observable, KeySelector, MarbleSelector, BinaryPredicate> traits_type;
typedef detail::group_by<value_type, Observable, KeySelector, MarbleSelector, BinaryPredicate> group_by_type;
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-lift.hpp b/Rx/v2/src/rxcpp/operators/rx-lift.hpp
index 58fa4d6..4e95cb2 100644
--- a/Rx/v2/src/rxcpp/operators/rx-lift.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-lift.hpp
@@ -20,8 +20,8 @@ struct is_lift_function_for {
template<class CS, class CF>
static tag_not_valid check(...);
- typedef typename std::decay<S>::type for_type;
- typedef typename std::decay<F>::type func_type;
+ typedef rxu::decay_t<S> for_type;
+ typedef rxu::decay_t<F> func_type;
typedef decltype(check<for_type, func_type>(0)) detail_result;
static const bool value = is_subscriber<detail_result>::value && is_subscriber<for_type>::value && std::is_convertible<V, typename rxu::value_type_from<detail_result>::type>::value;
};
@@ -35,9 +35,9 @@ namespace detail {
template<class ResultType, class SourceOperator, class Operator>
struct lift_traits
{
- typedef typename std::decay<ResultType>::type result_value_type;
- typedef typename std::decay<SourceOperator>::type source_operator_type;
- typedef typename std::decay<Operator>::type operator_type;
+ typedef rxu::decay_t<ResultType> result_value_type;
+ typedef rxu::decay_t<SourceOperator> source_operator_type;
+ typedef rxu::decay_t<Operator> operator_type;
typedef typename source_operator_type::value_type source_value_type;
@@ -70,7 +70,7 @@ struct lift_operator : public operator_base<typename lift_traits<ResultType, Sou
template<class ResultType, class Operator>
class lift_factory
{
- typedef typename std::decay<Operator>::type operator_type;
+ typedef rxu::decay_t<Operator> operator_type;
operator_type chain;
public:
lift_factory(operator_type op) : chain(std::move(op)) {}
@@ -78,7 +78,7 @@ public:
auto operator()(const Observable& source)
-> decltype(source.template lift<ResultType>(chain)) {
return source.template lift<ResultType>(chain);
- static_assert(rxcpp::detail::is_lift_function_for<typename Observable::value_type, subscriber<ResultType>, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber<T, ...>)");
+ static_assert(rxcpp::detail::is_lift_function_for<rxu::value_type_t<Observable>, subscriber<ResultType>, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber<T, ...>)");
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-map.hpp b/Rx/v2/src/rxcpp/operators/rx-map.hpp
index 662cf95..855f8eb 100644
--- a/Rx/v2/src/rxcpp/operators/rx-map.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-map.hpp
@@ -17,8 +17,8 @@ namespace detail {
template<class T, class Selector>
struct map
{
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Selector>::type select_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Selector> select_type;
typedef decltype((*(select_type*)nullptr)(*(source_value_type*)nullptr)) value_type;
select_type selector;
@@ -32,7 +32,7 @@ struct map
{
typedef map_observer<Subscriber> this_type;
typedef decltype((*(select_type*)nullptr)(*(source_value_type*)nullptr)) value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
dest_type dest;
select_type selector;
@@ -75,14 +75,14 @@ struct map
template<class Selector>
class map_factory
{
- typedef typename std::decay<Selector>::type select_type;
+ typedef rxu::decay_t<Selector> select_type;
select_type selector;
public:
map_factory(select_type s) : selector(std::move(s)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename map<typename std::decay<Observable>::type::value_type, select_type>::value_type>(map<typename std::decay<Observable>::type::value_type, select_type>(selector))) {
- return source.template lift<typename map<typename std::decay<Observable>::type::value_type, select_type>::value_type>(map<typename std::decay<Observable>::type::value_type, select_type>(selector));
+ -> decltype(source.template lift<rxu::value_type_t<map<rxu::value_type_t<rxu::decay_t<Observable>>, select_type>>>(map<rxu::value_type_t<rxu::decay_t<Observable>>, select_type>(selector))) {
+ return source.template lift<rxu::value_type_t<map<rxu::value_type_t<rxu::decay_t<Observable>>, select_type>>>(map<rxu::value_type_t<rxu::decay_t<Observable>>, select_type>(selector));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-merge.hpp b/Rx/v2/src/rxcpp/operators/rx-merge.hpp
index 9faa862..04d5a41 100644
--- a/Rx/v2/src/rxcpp/operators/rx-merge.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-merge.hpp
@@ -15,20 +15,20 @@ namespace detail {
template<class T, class Observable, class Coordination>
struct merge
- : public operator_base<typename std::decay<T>::type::value_type>
+ : public operator_base<rxu::value_type_t<rxu::decay_t<T>>>
{
//static_assert(is_observable<Observable>::value, "merge requires an observable");
//static_assert(is_observable<T>::value, "merge requires an observable that contains observables");
typedef merge<T, Observable, Coordination> this_type;
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Observable>::type source_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Observable> source_type;
typedef typename source_type::source_operator_type source_operator_type;
typedef typename source_value_type::value_type value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct values
@@ -172,7 +172,7 @@ struct merge
template<class Coordination>
class merge_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
coordination_type coordination;
public:
@@ -183,9 +183,9 @@ public:
template<class Observable>
auto operator()(Observable source)
- -> observable<typename merge<typename Observable::value_type, Observable, Coordination>::value_type, merge<typename Observable::value_type, Observable, Coordination>> {
- return observable<typename merge<typename Observable::value_type, Observable, Coordination>::value_type, merge<typename Observable::value_type, Observable, Coordination>>(
- merge<typename Observable::value_type, Observable, Coordination>(std::move(source), coordination));
+ -> observable<rxu::value_type_t<merge<rxu::value_type_t<Observable>, Observable, Coordination>>, merge<rxu::value_type_t<Observable>, Observable, Coordination>> {
+ return observable<rxu::value_type_t<merge<rxu::value_type_t<Observable>, Observable, Coordination>>, merge<rxu::value_type_t<Observable>, Observable, Coordination>>(
+ merge<rxu::value_type_t<Observable>, Observable, Coordination>(std::move(source), coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-multicast.hpp b/Rx/v2/src/rxcpp/operators/rx-multicast.hpp
index 966bfa3..e970bfe 100644
--- a/Rx/v2/src/rxcpp/operators/rx-multicast.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-multicast.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Observable, class Subject>
struct multicast : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Subject>::type subject_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Subject> subject_type;
struct multicast_state : public std::enable_shared_from_this<multicast_state>
{
@@ -76,9 +76,9 @@ public:
}
template<class Observable>
auto operator()(Observable&& source)
- -> connectable_observable<typename std::decay<Observable>::type::value_type, multicast<typename std::decay<Observable>::type::value_type, Observable, Subject>> {
- return connectable_observable<typename std::decay<Observable>::type::value_type, multicast<typename std::decay<Observable>::type::value_type, Observable, Subject>>(
- multicast<typename std::decay<Observable>::type::value_type, Observable, Subject>(std::forward<Observable>(source), caster));
+ -> connectable_observable<rxu::value_type_t<rxu::decay_t<Observable>>, multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject>> {
+ return connectable_observable<rxu::value_type_t<rxu::decay_t<Observable>>, multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject>>(
+ multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject>(std::forward<Observable>(source), caster));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-observe_on.hpp b/Rx/v2/src/rxcpp/operators/rx-observe_on.hpp
index 4d89044..8f52473 100644
--- a/Rx/v2/src/rxcpp/operators/rx-observe_on.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-observe_on.hpp
@@ -16,9 +16,9 @@ namespace detail {
template<class T, class Coordination>
struct observe_on
{
- typedef typename std::decay<T>::type source_value_type;
+ typedef rxu::decay_t<T> source_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
coordination_type coordination;
@@ -34,7 +34,7 @@ struct observe_on
typedef observe_on_observer<Subscriber> this_type;
typedef observer_base<source_value_type> base_type;
typedef source_value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<value_type, this_type> observer_type;
typedef rxn::notification<T> notification_type;
@@ -184,14 +184,14 @@ struct observe_on
template<class Coordination>
class observe_on_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
coordination_type coordination;
public:
observe_on_factory(coordination_type cn) : coordination(std::move(cn)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename std::decay<Observable>::type::value_type>(observe_on<typename std::decay<Observable>::type::value_type, coordination_type>(coordination))) {
- return source.template lift<typename std::decay<Observable>::type::value_type>(observe_on<typename std::decay<Observable>::type::value_type, coordination_type>(coordination));
+ -> decltype(source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(observe_on<rxu::value_type_t<rxu::decay_t<Observable>>, coordination_type>(coordination))) {
+ return source.template lift<rxu::value_type_t<rxu::decay_t<Observable>>>(observe_on<rxu::value_type_t<rxu::decay_t<Observable>>, coordination_type>(coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-pairwise.hpp b/Rx/v2/src/rxcpp/operators/rx-pairwise.hpp
index 582aba5..8531e8c 100644
--- a/Rx/v2/src/rxcpp/operators/rx-pairwise.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-pairwise.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T>
struct pairwise
{
- typedef typename std::decay<T>::type source_value_type;
+ typedef rxu::decay_t<T> source_value_type;
typedef std::tuple<source_value_type, source_value_type> value_type;
template<class Subscriber>
@@ -24,7 +24,7 @@ struct pairwise
{
typedef pairwise_observer<Subscriber> this_type;
typedef std::tuple<source_value_type, source_value_type> value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
dest_type dest;
mutable rxu::detail::maybe<source_value_type> remembered;
@@ -67,8 +67,8 @@ class pairwise_factory
public:
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<typename pairwise<typename std::decay<Observable>::type::value_type>::value_type>(pairwise<typename std::decay<Observable>::type::value_type>())) {
- return source.template lift<typename pairwise<typename std::decay<Observable>::type::value_type>::value_type>(pairwise<typename std::decay<Observable>::type::value_type>());
+ -> decltype(source.template lift<rxu::value_type_t<pairwise<rxu::value_type_t<rxu::decay_t<Observable>>>>>(pairwise<rxu::value_type_t<rxu::decay_t<Observable>>>())) {
+ return source.template lift<rxu::value_type_t<pairwise<rxu::value_type_t<rxu::decay_t<Observable>>>>>(pairwise<rxu::value_type_t<rxu::decay_t<Observable>>>());
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-publish.hpp b/Rx/v2/src/rxcpp/operators/rx-publish.hpp
index 34de51a..3589cc9 100644
--- a/Rx/v2/src/rxcpp/operators/rx-publish.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-publish.hpp
@@ -20,10 +20,10 @@ public:
publish_factory() {}
template<class Observable>
auto operator()(Observable&& source)
- -> connectable_observable<typename std::decay<Observable>::type::value_type, multicast<typename std::decay<Observable>::type::value_type, Observable, Subject<typename std::decay<Observable>::type::value_type>>> {
- return connectable_observable<typename std::decay<Observable>::type::value_type, multicast<typename std::decay<Observable>::type::value_type, Observable, Subject<typename std::decay<Observable>::type::value_type>>>(
- multicast<typename std::decay<Observable>::type::value_type, Observable, Subject<typename std::decay<Observable>::type::value_type>>(
- std::forward<Observable>(source), Subject<typename std::decay<Observable>::type::value_type>()));
+ -> connectable_observable<rxu::value_type_t<rxu::decay_t<Observable>>, multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject<rxu::value_type_t<rxu::decay_t<Observable>>>>> {
+ return connectable_observable<rxu::value_type_t<rxu::decay_t<Observable>>, multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject<rxu::value_type_t<rxu::decay_t<Observable>>>>>(
+ multicast<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Subject<rxu::value_type_t<rxu::decay_t<Observable>>>>(
+ std::forward<Observable>(source), Subject<rxu::value_type_t<rxu::decay_t<Observable>>>()));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-reduce.hpp b/Rx/v2/src/rxcpp/operators/rx-reduce.hpp
index 9d3d39b..1c740bc 100644
--- a/Rx/v2/src/rxcpp/operators/rx-reduce.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-reduce.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Seed, class Accumulator>
struct is_accumulate_function_for {
- typedef typename std::decay<Accumulator>::type accumulator_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<Accumulator> accumulator_type;
+ typedef rxu::decay_t<Seed> seed_type;
typedef T source_value_type;
struct tag_not_valid {};
@@ -33,8 +33,8 @@ struct is_accumulate_function_for {
template<class Seed, class ResultSelector>
struct is_result_function_for {
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Seed> seed_type;
struct tag_not_valid {};
@@ -50,10 +50,10 @@ struct is_result_function_for {
template<class T, class SourceOperator, class Accumulator, class ResultSelector, class Seed>
struct reduce_traits
{
- typedef typename std::decay<SourceOperator>::type source_type;
- typedef typename std::decay<Accumulator>::type accumulator_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<SourceOperator> source_type;
+ typedef rxu::decay_t<Accumulator> accumulator_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Seed> seed_type;
typedef T source_value_type;
@@ -65,7 +65,7 @@ struct reduce_traits
};
template<class T, class SourceOperator, class Accumulator, class ResultSelector, class Seed>
-struct reduce : public operator_base<typename reduce_traits<T, SourceOperator, Accumulator, ResultSelector, Seed>::value_type>
+struct reduce : public operator_base<rxu::value_type_t<reduce_traits<T, SourceOperator, Accumulator, ResultSelector, Seed>>>
{
typedef reduce<T, SourceOperator, Accumulator, ResultSelector, Seed> this_type;
typedef reduce_traits<T, SourceOperator, Accumulator, ResultSelector, Seed> traits;
@@ -164,9 +164,9 @@ private:
template<class Accumulator, class ResultSelector, class Seed>
class reduce_factory
{
- typedef typename std::decay<Accumulator>::type accumulator_type;
- typedef typename std::decay<ResultSelector>::type result_selector_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<Accumulator> accumulator_type;
+ typedef rxu::decay_t<ResultSelector> result_selector_type;
+ typedef rxu::decay_t<Seed> seed_type;
accumulator_type accumulator;
result_selector_type result_selector;
@@ -180,9 +180,9 @@ public:
}
template<class Observable>
auto operator()(const Observable& source)
- -> observable<seed_type, reduce<typename Observable::value_type, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>> {
- return observable<seed_type, reduce<typename Observable::value_type, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>>(
- reduce<typename Observable::value_type, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>(source.source_operator, accumulator, result_selector, seed));
+ -> observable<seed_type, reduce<rxu::value_type_t<Observable>, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>> {
+ return observable<seed_type, reduce<rxu::value_type_t<Observable>, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>>(
+ reduce<rxu::value_type_t<Observable>, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>(source.source_operator, accumulator, result_selector, seed));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-ref_count.hpp b/Rx/v2/src/rxcpp/operators/rx-ref_count.hpp
index 41e4bd9..2d41ef2 100644
--- a/Rx/v2/src/rxcpp/operators/rx-ref_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-ref_count.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T, class ConnectableObservable>
struct ref_count : public operator_base<T>
{
- typedef typename std::decay<ConnectableObservable>::type source_type;
+ typedef rxu::decay_t<ConnectableObservable> source_type;
struct ref_count_state : public std::enable_shared_from_this<ref_count_state>
{
@@ -65,9 +65,9 @@ public:
ref_count_factory() {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, ref_count<typename std::decay<Observable>::type::value_type, Observable>> {
- return observable<typename std::decay<Observable>::type::value_type, ref_count<typename std::decay<Observable>::type::value_type, Observable>>(
- ref_count<typename std::decay<Observable>::type::value_type, Observable>(std::forward<Observable>(source)));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, ref_count<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, ref_count<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>>(
+ ref_count<rxu::value_type_t<rxu::decay_t<Observable>>, Observable>(std::forward<Observable>(source)));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-repeat.hpp b/Rx/v2/src/rxcpp/operators/rx-repeat.hpp
index 91f59b8..b9038ac 100644
--- a/Rx/v2/src/rxcpp/operators/rx-repeat.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-repeat.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Observable, class Count>
struct repeat : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Count>::type count_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Count> count_type;
struct values
{
values(source_type s, count_type t)
@@ -94,16 +94,16 @@ struct repeat : public operator_base<T>
template<class T>
class repeat_factory
{
- typedef typename std::decay<T>::type count_type;
+ typedef rxu::decay_t<T> count_type;
count_type count;
public:
repeat_factory(count_type t) : count(std::move(t)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, repeat<typename std::decay<Observable>::type::value_type, Observable, count_type>> {
- return observable<typename std::decay<Observable>::type::value_type, repeat<typename std::decay<Observable>::type::value_type, Observable, count_type>>(
- repeat<typename std::decay<Observable>::type::value_type, Observable, count_type>(std::forward<Observable>(source), count));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, repeat<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, repeat<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>>(
+ repeat<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>(std::forward<Observable>(source), count));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-retry.hpp b/Rx/v2/src/rxcpp/operators/rx-retry.hpp
index 112edef..acfa20b 100644
--- a/Rx/v2/src/rxcpp/operators/rx-retry.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-retry.hpp
@@ -15,8 +15,8 @@ namespace rxcpp {
template<class T, class Observable, class Count>
struct retry : public operator_base<T> {
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Count>::type count_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Count> count_type;
struct values {
values(source_type s, count_type t)
: source(std::move(s))
@@ -90,16 +90,16 @@ namespace rxcpp {
template<class T>
class retry_factory {
- typedef typename std::decay<T>::type count_type;
+ typedef rxu::decay_t<T> count_type;
count_type count;
public:
retry_factory(count_type t) : count(std::move(t)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, retry<typename std::decay<Observable>::type::value_type, Observable, count_type>> {
- return observable<typename std::decay<Observable>::type::value_type, retry<typename std::decay<Observable>::type::value_type, Observable, count_type>>(
- retry<typename std::decay<Observable>::type::value_type, Observable, count_type>(std::forward<Observable>(source), count));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, retry<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, retry<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>>(
+ retry<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>(std::forward<Observable>(source), count));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-scan.hpp b/Rx/v2/src/rxcpp/operators/rx-scan.hpp
index 1b45437..7f2a314 100644
--- a/Rx/v2/src/rxcpp/operators/rx-scan.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-scan.hpp
@@ -14,11 +14,11 @@ namespace operators {
namespace detail {
template<class T, class Observable, class Accumulator, class Seed>
-struct scan : public operator_base<typename std::decay<Seed>::type>
+struct scan : public operator_base<rxu::decay_t<Seed>>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Accumulator>::type accumulator_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Accumulator> accumulator_type;
+ typedef rxu::decay_t<Seed> seed_type;
struct scan_initial_type
{
@@ -88,8 +88,8 @@ struct scan : public operator_base<typename std::decay<Seed>::type>
template<class Accumulator, class Seed>
class scan_factory
{
- typedef typename std::decay<Accumulator>::type accumulator_type;
- typedef typename std::decay<Seed>::type seed_type;
+ typedef rxu::decay_t<Accumulator> accumulator_type;
+ typedef rxu::decay_t<Seed> seed_type;
accumulator_type accumulator;
seed_type seed;
@@ -101,9 +101,9 @@ public:
}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Seed>::type, scan<typename std::decay<Observable>::type::value_type, Observable, Accumulator, Seed>> {
- return observable<typename std::decay<Seed>::type, scan<typename std::decay<Observable>::type::value_type, Observable, Accumulator, Seed>>(
- scan<typename std::decay<Observable>::type::value_type, Observable, Accumulator, Seed>(std::forward<Observable>(source), accumulator, seed));
+ -> observable<rxu::decay_t<Seed>, scan<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Accumulator, Seed>> {
+ return observable<rxu::decay_t<Seed>, scan<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Accumulator, Seed>>(
+ scan<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Accumulator, Seed>(std::forward<Observable>(source), accumulator, seed));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-skip.hpp b/Rx/v2/src/rxcpp/operators/rx-skip.hpp
index 3fa7209..94ebe5a 100644
--- a/Rx/v2/src/rxcpp/operators/rx-skip.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-skip.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Observable, class Count>
struct skip : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Count>::type count_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Count> count_type;
struct values
{
values(source_type s, count_type t)
@@ -99,15 +99,15 @@ struct skip : public operator_base<T>
template<class T>
class skip_factory
{
- typedef typename std::decay<T>::type count_type;
+ typedef rxu::decay_t<T> count_type;
count_type count;
public:
skip_factory(count_type t) : count(std::move(t)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, skip<typename std::decay<Observable>::type::value_type, Observable, count_type>> {
- return observable<typename std::decay<Observable>::type::value_type, skip<typename std::decay<Observable>::type::value_type, Observable, count_type>>(
- skip<typename std::decay<Observable>::type::value_type, Observable, count_type>(std::forward<Observable>(source), count));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, skip<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, skip<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>>(
+ skip<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>(std::forward<Observable>(source), count));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-skip_until.hpp b/Rx/v2/src/rxcpp/operators/rx-skip_until.hpp
index 49441e4..4b4644f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-skip_until.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-skip_until.hpp
@@ -16,9 +16,9 @@ namespace detail {
template<class T, class Observable, class TriggerObservable, class Coordination>
struct skip_until : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<TriggerObservable>::type trigger_source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<TriggerObservable> trigger_source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct values
{
@@ -164,8 +164,8 @@ struct skip_until : public operator_base<T>
template<class TriggerObservable, class Coordination>
class skip_until_factory
{
- typedef typename std::decay<TriggerObservable>::type trigger_source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<TriggerObservable> trigger_source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
trigger_source_type trigger_source;
coordination_type coordination;
@@ -177,9 +177,9 @@ public:
}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, skip_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>> {
- return observable<typename std::decay<Observable>::type::value_type, skip_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>>(
- skip_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>(std::forward<Observable>(source), trigger_source, coordination));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, skip_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, skip_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>>(
+ skip_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>(std::forward<Observable>(source), trigger_source, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-start_with.hpp b/Rx/v2/src/rxcpp/operators/rx-start_with.hpp
index d605ceb..16e909f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-start_with.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-start_with.hpp
@@ -13,8 +13,8 @@ namespace operators {
template<class Observable, class Value0, class... ValueN>
auto start_with(Observable o, Value0 v0, ValueN... vn)
- -> decltype(rxs::from(typename Observable::value_type(v0), typename Observable::value_type(vn)...).concat(o)) {
- return rxs::from(typename Observable::value_type(v0), typename Observable::value_type(vn)...).concat(o);
+ -> decltype(rxs::from(rxu::value_type_t<Observable>(v0), rxu::value_type_t<Observable>(vn)...).concat(o)) {
+ return rxs::from(rxu::value_type_t<Observable>(v0), rxu::value_type_t<Observable>(vn)...).concat(o);
}
}
diff --git a/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp b/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
index cc25c1d..af74d2e 100644
--- a/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
@@ -77,8 +77,8 @@ class dynamic_factory
public:
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type> {
- return observable<typename std::decay<Observable>::type::value_type>(std::forward<Observable>(source));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>>(std::forward<Observable>(source));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp b/Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp
index c1adb2c..4142890 100644
--- a/Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Observable, class Coordination>
struct subscribe_on : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct subscribe_on_values
{
@@ -110,7 +110,7 @@ private:
template<class Coordination>
class subscribe_on_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
coordination_type coordination;
public:
@@ -120,9 +120,9 @@ public:
}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, subscribe_on<typename std::decay<Observable>::type::value_type, Observable, Coordination>> {
- return observable<typename std::decay<Observable>::type::value_type, subscribe_on<typename std::decay<Observable>::type::value_type, Observable, Coordination>>(
- subscribe_on<typename std::decay<Observable>::type::value_type, Observable, Coordination>(std::forward<Observable>(source), coordination));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, subscribe_on<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Coordination>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, subscribe_on<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Coordination>>(
+ subscribe_on<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, Coordination>(std::forward<Observable>(source), coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp b/Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp
index 3403553..a3620b2 100644
--- a/Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp
@@ -15,22 +15,22 @@ namespace detail {
template<class T, class Observable, class Coordination>
struct switch_on_next
- : public operator_base<typename std::decay<T>::type::value_type>
+ : public operator_base<rxu::value_type_t<rxu::decay_t<T>>>
{
//static_assert(is_observable<Observable>::value, "switch_on_next requires an observable");
//static_assert(is_observable<T>::value, "switch_on_next requires an observable that contains observables");
typedef switch_on_next<T, Observable, Coordination> this_type;
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Observable>::type source_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Observable> source_type;
typedef typename source_type::source_operator_type source_operator_type;
typedef source_value_type collection_type;
typedef typename collection_type::value_type collection_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct values
@@ -183,7 +183,7 @@ struct switch_on_next
template<class Coordination>
class switch_on_next_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
coordination_type coordination;
public:
@@ -194,9 +194,9 @@ public:
template<class Observable>
auto operator()(Observable source)
- -> observable<typename switch_on_next<typename Observable::value_type, Observable, Coordination>::value_type, switch_on_next<typename Observable::value_type, Observable, Coordination>> {
- return observable<typename switch_on_next<typename Observable::value_type, Observable, Coordination>::value_type, switch_on_next<typename Observable::value_type, Observable, Coordination>>(
- switch_on_next<typename Observable::value_type, Observable, Coordination>(std::move(source), coordination));
+ -> observable<rxu::value_type_t<switch_on_next<rxu::value_type_t<Observable>, Observable, Coordination>>, switch_on_next<rxu::value_type_t<Observable>, Observable, Coordination>> {
+ return observable<rxu::value_type_t<switch_on_next<rxu::value_type_t<Observable>, Observable, Coordination>>, switch_on_next<rxu::value_type_t<Observable>, Observable, Coordination>>(
+ switch_on_next<rxu::value_type_t<Observable>, Observable, Coordination>(std::move(source), coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-take.hpp b/Rx/v2/src/rxcpp/operators/rx-take.hpp
index 5043385..182a20f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-take.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-take.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class T, class Observable, class Count>
struct take : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<Count>::type count_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<Count> count_type;
struct values
{
values(source_type s, count_type t)
@@ -103,15 +103,15 @@ struct take : public operator_base<T>
template<class T>
class take_factory
{
- typedef typename std::decay<T>::type count_type;
+ typedef rxu::decay_t<T> count_type;
count_type count;
public:
take_factory(count_type t) : count(std::move(t)) {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, take<typename std::decay<Observable>::type::value_type, Observable, count_type>> {
- return observable<typename std::decay<Observable>::type::value_type, take<typename std::decay<Observable>::type::value_type, Observable, count_type>>(
- take<typename std::decay<Observable>::type::value_type, Observable, count_type>(std::forward<Observable>(source), count));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, take<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, take<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>>(
+ take<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, count_type>(std::forward<Observable>(source), count));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-take_until.hpp b/Rx/v2/src/rxcpp/operators/rx-take_until.hpp
index b1fb8ff..e4109cd 100644
--- a/Rx/v2/src/rxcpp/operators/rx-take_until.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-take_until.hpp
@@ -16,9 +16,9 @@ namespace detail {
template<class T, class Observable, class TriggerObservable, class Coordination>
struct take_until : public operator_base<T>
{
- typedef typename std::decay<Observable>::type source_type;
- typedef typename std::decay<TriggerObservable>::type trigger_source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Observable> source_type;
+ typedef rxu::decay_t<TriggerObservable> trigger_source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct values
{
@@ -162,8 +162,8 @@ struct take_until : public operator_base<T>
template<class TriggerObservable, class Coordination>
class take_until_factory
{
- typedef typename std::decay<TriggerObservable>::type trigger_source_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<TriggerObservable> trigger_source_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
trigger_source_type trigger_source;
coordination_type coordination;
@@ -175,9 +175,9 @@ public:
}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, take_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>> {
- return observable<typename std::decay<Observable>::type::value_type, take_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>>(
- take_until<typename std::decay<Observable>::type::value_type, Observable, trigger_source_type, Coordination>(std::forward<Observable>(source), trigger_source, coordination));
+ -> observable<rxu::value_type_t<rxu::decay_t<Observable>>, take_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>> {
+ return observable<rxu::value_type_t<rxu::decay_t<Observable>>, take_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>>(
+ take_until<rxu::value_type_t<rxu::decay_t<Observable>>, Observable, trigger_source_type, Coordination>(std::forward<Observable>(source), trigger_source, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-window.hpp b/Rx/v2/src/rxcpp/operators/rx-window.hpp
index c2bf220..57d04f0 100644
--- a/Rx/v2/src/rxcpp/operators/rx-window.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-window.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T>
struct window
{
- typedef typename std::decay<T>::type source_value_type;
+ typedef rxu::decay_t<T> source_value_type;
struct window_values
{
window_values(int c, int s)
@@ -41,7 +41,7 @@ struct window
typedef window_observer<Subscriber> this_type;
typedef observer_base<observable<T>> base_type;
typedef typename base_type::value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
dest_type dest;
mutable int cursor;
@@ -107,8 +107,8 @@ public:
window_factory(int c, int s) : count(c), skip(s) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window<typename std::decay<Observable>::type::value_type>(count, skip))) {
- return source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window<typename std::decay<Observable>::type::value_type>(count, skip));
+ -> decltype(source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window<rxu::value_type_t<rxu::decay_t<Observable>>>(count, skip))) {
+ return source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window<rxu::value_type_t<rxu::decay_t<Observable>>>(count, skip));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-window_time.hpp b/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
index aca16de..734520e 100644
--- a/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-window_time.hpp
@@ -16,10 +16,10 @@ namespace detail {
template<class T, class Duration, class Coordination>
struct window_with_time
{
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
- typedef typename std::decay<Duration>::type duration_type;
+ typedef rxu::decay_t<Duration> duration_type;
struct window_with_time_values
{
@@ -46,7 +46,7 @@ struct window_with_time
typedef window_with_time_observer<Subscriber> this_type;
typedef observer_base<observable<T>> base_type;
typedef typename base_type::value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
struct window_with_time_subscriber_values : public window_with_time_values
@@ -128,8 +128,8 @@ struct window_with_time
template<class Duration, class Coordination>
class window_with_time_factory
{
- typedef typename std::decay<Duration>::type duration_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Duration> duration_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
duration_type period;
duration_type skip;
@@ -138,8 +138,8 @@ public:
window_with_time_factory(duration_type p, duration_type s, coordination_type c) : period(p), skip(s), coordination(c) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window_with_time<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination))) {
- return source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window_with_time<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, skip, coordination));
+ -> decltype(source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window_with_time<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination))) {
+ return source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window_with_time<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, skip, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp b/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
index a3e45f4..fa50a57 100644
--- a/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp
@@ -16,10 +16,10 @@ namespace detail {
template<class T, class Duration, class Coordination>
struct window_with_time_or_count
{
- typedef typename std::decay<T>::type source_value_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<T> source_value_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
- typedef typename std::decay<Duration>::type duration_type;
+ typedef rxu::decay_t<Duration> duration_type;
struct window_with_time_or_count_values
{
@@ -46,7 +46,7 @@ struct window_with_time_or_count
typedef window_with_time_or_count_observer<Subscriber> this_type;
typedef observer_base<observable<T>> base_type;
typedef typename base_type::value_type value_type;
- typedef typename std::decay<Subscriber>::type dest_type;
+ typedef rxu::decay_t<Subscriber> dest_type;
typedef observer<T, this_type> observer_type;
struct window_with_time_or_count_subscriber_values : public window_with_time_or_count_values
@@ -133,8 +133,8 @@ struct window_with_time_or_count
template<class Duration, class Coordination>
class window_with_time_or_count_factory
{
- typedef typename std::decay<Duration>::type duration_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Duration> duration_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
duration_type period;
int count;
@@ -143,8 +143,8 @@ public:
window_with_time_or_count_factory(duration_type p, int n, coordination_type c) : period(p), count(n), coordination(c) {}
template<class Observable>
auto operator()(Observable&& source)
- -> decltype(source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window_with_time_or_count<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, count, coordination))) {
- return source.template lift<observable<typename std::decay<Observable>::type::value_type>>(window_with_time_or_count<typename std::decay<Observable>::type::value_type, Duration, Coordination>(period, count, coordination));
+ -> decltype(source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window_with_time_or_count<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, count, coordination))) {
+ return source.template lift<observable<rxu::value_type_t<rxu::decay_t<Observable>>>>(window_with_time_or_count<rxu::value_type_t<rxu::decay_t<Observable>>, Duration, Coordination>(period, count, coordination));
}
};
diff --git a/Rx/v2/src/rxcpp/operators/rx-zip.hpp b/Rx/v2/src/rxcpp/operators/rx-zip.hpp
index a391c48..19e03f6 100644
--- a/Rx/v2/src/rxcpp/operators/rx-zip.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-zip.hpp
@@ -18,8 +18,8 @@ struct zip_traits {
typedef std::tuple<ObservableN...> tuple_source_type;
typedef std::tuple<std::list<typename ObservableN::value_type>...> tuple_source_values_type;
- typedef typename std::decay<Selector>::type selector_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Selector> selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
struct tag_not_valid {};
template<class CS, class... CVN>
@@ -33,7 +33,7 @@ struct zip_traits {
};
template<class Coordination, class Selector, class... ObservableN>
-struct zip : public operator_base<typename zip_traits<Coordination, Selector, ObservableN...>::value_type>
+struct zip : public operator_base<rxu::value_type_t<zip_traits<Coordination, Selector, ObservableN...>>>
{
typedef zip<Coordination, Selector, ObservableN...> this_type;
@@ -171,8 +171,8 @@ struct zip : public operator_base<typename zip_traits<Coordination, Selector, Ob
template<class Coordination, class Selector, class... ObservableN>
class zip_factory
{
- typedef typename std::decay<Coordination>::type coordination_type;
- typedef typename std::decay<Selector>::type selector_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
+ typedef rxu::decay_t<Selector> selector_type;
typedef std::tuple<ObservableN...> tuple_source_type;
coordination_type coordination;
@@ -181,9 +181,9 @@ class zip_factory
template<class... YObservableN>
auto make(std::tuple<YObservableN...> source)
- -> observable<typename zip<Coordination, Selector, YObservableN...>::value_type, zip<Coordination, Selector, YObservableN...>> {
- return observable<typename zip<Coordination, Selector, YObservableN...>::value_type, zip<Coordination, Selector, YObservableN...>>(
- zip<Coordination, Selector, YObservableN...>(coordination, selector, std::move(source)));
+ -> observable<rxu::value_type_t<zip<Coordination, Selector, YObservableN...>>, zip<Coordination, Selector, YObservableN...>> {
+ return observable<rxu::value_type_t<zip<Coordination, Selector, YObservableN...>>, zip<Coordination, Selector, YObservableN...>>(
+ zip<Coordination, Selector, YObservableN...>(coordination, selector, std::move(source)));
}
public:
zip_factory(coordination_type sf, selector_type s, ObservableN... on)
diff --git a/Rx/v2/src/rxcpp/rx-connectable_observable.hpp b/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
index 731d844..b650b09 100644
--- a/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
@@ -51,7 +51,7 @@ class dynamic_connectable_observable
template<class SO>
void construct(SO&& source, rxs::tag_source&&) {
- auto so = std::make_shared<typename std::decay<SO>::type>(std::forward<SO>(source));
+ auto so = std::make_shared<rxu::decay_t<SO>>(std::forward<SO>(source));
state->on_connect = [so](composite_subscription cs) mutable {
so->on_connect(std::move(cs));
};
@@ -102,7 +102,7 @@ class connectable_observable
{
typedef connectable_observable<T, SourceOperator> this_type;
typedef observable<T, SourceOperator> base_type;
- typedef typename std::decay<SourceOperator>::type source_operator_type;
+ typedef rxu::decay_t<SourceOperator> source_operator_type;
static_assert(detail::has_on_connect<source_operator_type>::value, "inner must have on_connect method void(composite_subscription)");
diff --git a/Rx/v2/src/rxcpp/rx-coordination.hpp b/Rx/v2/src/rxcpp/rx-coordination.hpp
index 23c5405..0b95db3 100644
--- a/Rx/v2/src/rxcpp/rx-coordination.hpp
+++ b/Rx/v2/src/rxcpp/rx-coordination.hpp
@@ -193,7 +193,7 @@ class serialize_one_worker : public coordination_base
struct serialize_observer
{
typedef serialize_observer<Observer> this_type;
- typedef typename std::decay<Observer>::type dest_type;
+ typedef rxu::decay_t<Observer> dest_type;
typedef typename dest_type::value_type value_type;
typedef observer<value_type, this_type> observer_type;
dest_type dest;
diff --git a/Rx/v2/src/rxcpp/rx-grouped_observable.hpp b/Rx/v2/src/rxcpp/rx-grouped_observable.hpp
index 84deef9..8c81400 100644
--- a/Rx/v2/src/rxcpp/rx-grouped_observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-grouped_observable.hpp
@@ -21,7 +21,7 @@ struct has_on_get_key_for
static not_void check(...);
typedef decltype(check<Source>(0)) detail_result;
- static const bool value = std::is_same<detail_result, typename std::decay<K>::type>::value;
+ static const bool value = std::is_same<detail_result, rxu::decay_t<K>>::value;
};
}
@@ -31,7 +31,7 @@ class dynamic_grouped_observable
: public dynamic_observable<T>
{
public:
- typedef typename std::decay<K>::type key_type;
+ typedef rxu::decay_t<K> key_type;
typedef tag_dynamic_grouped_observable dynamic_observable_tag;
private:
@@ -59,7 +59,7 @@ private:
template<class SO>
void construct(SO&& source, const rxs::tag_source&) {
- auto so = std::make_shared<typename std::decay<SO>::type>(std::forward<SO>(source));
+ auto so = std::make_shared<rxu::decay_t<SO>>(std::forward<SO>(source));
state->on_get_key = [so]() mutable {
return so->on_get_key();
};
@@ -117,12 +117,12 @@ class grouped_observable
{
typedef grouped_observable<K, T, SourceOperator> this_type;
typedef observable<T, SourceOperator> base_type;
- typedef typename std::decay<SourceOperator>::type source_operator_type;
+ typedef rxu::decay_t<SourceOperator> source_operator_type;
static_assert(detail::has_on_get_key_for<K, source_operator_type>::value, "inner must have on_get_key method key_type()");
public:
- typedef typename std::decay<K>::type key_type;
+ typedef rxu::decay_t<K> key_type;
typedef tag_grouped_observable observable_tag;
grouped_observable()
diff --git a/Rx/v2/src/rxcpp/rx-notification.hpp b/Rx/v2/src/rxcpp/rx-notification.hpp
index 0ba09ea..f8cafbb 100644
--- a/Rx/v2/src/rxcpp/rx-notification.hpp
+++ b/Rx/v2/src/rxcpp/rx-notification.hpp
@@ -224,7 +224,7 @@ private:
template<typename Exception>
type operator()(Exception&& e) const {
return make_on_error(typename std::conditional<
- std::is_same<typename std::decay<Exception>::type, std::exception_ptr>::value,
+ std::is_same<rxu::decay_t<Exception>, std::exception_ptr>::value,
exception_ptr_tag, exception_tag>::type(),
std::forward<Exception>(e));
}
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index d1e60fc..bb0e275 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -26,8 +26,8 @@ struct is_operator_factory_for
template<class CS, class CF>
static not_void check(...);
- typedef typename std::decay<Source>::type source_type;
- typedef typename std::decay<F>::type function_type;
+ typedef rxu::decay_t<Source> source_type;
+ typedef rxu::decay_t<F> function_type;
typedef decltype(check<source_type, function_type>(0)) detail_result;
static const bool value = !std::is_same<detail_result, not_void>::value && is_observable<source_type>::value;
@@ -42,7 +42,7 @@ struct has_on_subscribe_for
template<class CS, class CT>
static not_void check(...);
- typedef decltype(check<typename std::decay<Subscriber>::type, T>(0)) detail_result;
+ typedef decltype(check<rxu::decay_t<Subscriber>, T>(0)) detail_result;
static const bool value = std::is_same<detail_result, void>::value;
};
@@ -66,7 +66,7 @@ class dynamic_observable
template<class SO>
void construct(SO&& source, rxs::tag_source&&) {
- typename std::decay<SO>::type so = std::forward<SO>(source);
+ rxu::decay_t<SO> so = std::forward<SO>(source);
state->on_subscribe = [so](subscriber<T> o) mutable {
so.on_subscribe(std::move(o));
};
@@ -234,7 +234,7 @@ class blocking_observable
}
public:
- typedef typename std::decay<Observable>::type observable_type;
+ typedef rxu::decay_t<Observable> observable_type;
observable_type source;
~blocking_observable()
{
@@ -296,7 +296,7 @@ class observable
typedef observable<T, SourceOperator> this_type;
public:
- typedef typename std::decay<SourceOperator>::type source_operator_type;
+ typedef rxu::decay_t<SourceOperator> source_operator_type;
mutable source_operator_type source_operator;
private:
@@ -311,7 +311,7 @@ private:
auto detail_subscribe(Subscriber o) const
-> composite_subscription {
- typedef typename std::decay<Subscriber>::type subscriber_type;
+ typedef rxu::decay_t<Subscriber> subscriber_type;
static_assert(is_subscriber<subscriber_type>::value, "subscribe must be passed a subscriber");
static_assert(std::is_same<typename source_operator_type::value_type, T>::value && std::is_convertible<T*, typename subscriber_type::value_type*>::value, "the value types in the sequence must match or be convertible");
@@ -426,9 +426,9 @@ public:
///
template<class ResultType, class Operator>
auto lift(Operator&& op) const
- -> observable<typename rxo::detail::lift_operator<ResultType, source_operator_type, Operator>::value_type, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>> {
- return observable<typename rxo::detail::lift_operator<ResultType, source_operator_type, Operator>::value_type, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>(
- rxo::detail::lift_operator<ResultType, source_operator_type, Operator>(source_operator, std::forward<Operator>(op)));
+ -> observable<rxu::value_type_t<rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>> {
+ return observable<rxu::value_type_t<rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>(
+ rxo::detail::lift_operator<ResultType, source_operator_type, Operator>(source_operator, std::forward<Operator>(op)));
static_assert(detail::is_lift_function_for<T, subscriber<ResultType>, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber<T, ...>)");
}
@@ -440,9 +440,9 @@ public:
template<class ResultType, class Operator>
auto lift_if(Operator&& op) const
-> typename std::enable_if<detail::is_lift_function_for<T, subscriber<ResultType>, Operator>::value,
- observable<typename rxo::detail::lift_operator<ResultType, source_operator_type, Operator>::value_type, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>>::type {
- return observable<typename rxo::detail::lift_operator<ResultType, source_operator_type, Operator>::value_type, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>(
- rxo::detail::lift_operator<ResultType, source_operator_type, Operator>(source_operator, std::forward<Operator>(op)));
+ observable<rxu::value_type_t<rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>>::type {
+ return observable<rxu::value_type_t<rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>(
+ rxo::detail::lift_operator<ResultType, source_operator_type, Operator>(source_operator, std::forward<Operator>(op)));
}
///
/// takes any function that will take a subscriber for this observable and produce a subscriber.
@@ -494,8 +494,8 @@ public:
///
template<class Selector>
auto map(Selector s) const
- -> decltype(EXPLICIT_THIS lift<typename rxo::detail::map<T, Selector>::value_type>(rxo::detail::map<T, Selector>(std::move(s)))) {
- return lift<typename rxo::detail::map<T, Selector>::value_type>(rxo::detail::map<T, Selector>(std::move(s)));
+ -> decltype(EXPLICIT_THIS lift<rxu::value_type_t<rxo::detail::map<T, Selector>>>(rxo::detail::map<T, Selector>(std::move(s)))) {
+ return lift<rxu::value_type_t<rxo::detail::map<T, Selector>>>(rxo::detail::map<T, Selector>(std::move(s)));
}
/// distinct_until_changed ->
@@ -747,9 +747,9 @@ public:
///
template<class CollectionSelector, class ResultSelector>
auto flat_map(CollectionSelector&& s, ResultSelector&& rs) const
- -> observable<typename rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>::value_type, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>> {
- return observable<typename rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>::value_type, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>(
- rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), identity_current_thread()));
+ -> observable<rxu::value_type_t<rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>> {
+ return observable<rxu::value_type_t<rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>(
+ rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), identity_current_thread()));
}
/// flat_map (AKA SelectMany) ->
@@ -759,9 +759,9 @@ public:
///
template<class CollectionSelector, class ResultSelector, class Coordination>
auto flat_map(CollectionSelector&& s, ResultSelector&& rs, Coordination&& sf) const
- -> observable<typename rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>::value_type, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>> {
- return observable<typename rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>::value_type, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>>(
- rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), std::forward<Coordination>(sf)));
+ -> observable<rxu::value_type_t<rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>>, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>> {
+ return observable<rxu::value_type_t<rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>>, rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>>(
+ rxo::detail::flat_map<this_type, CollectionSelector, ResultSelector, Coordination>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), std::forward<Coordination>(sf)));
}
template<class Coordination>
@@ -838,9 +838,9 @@ public:
///
template<class CollectionSelector, class ResultSelector>
auto concat_map(CollectionSelector&& s, ResultSelector&& rs) const
- -> observable<typename rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>::value_type, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>> {
- return observable<typename rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>::value_type, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>(
- rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), identity_current_thread()));
+ -> observable<rxu::value_type_t<rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>> {
+ return observable<rxu::value_type_t<rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>>(
+ rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, identity_one_worker>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), identity_current_thread()));
}
/// concat_map ->
@@ -850,9 +850,9 @@ public:
///
template<class CollectionSelector, class ResultSelector, class Coordination>
auto concat_map(CollectionSelector&& s, ResultSelector&& rs, Coordination&& sf) const
- -> observable<typename rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>::value_type, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>> {
- return observable<typename rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>::value_type, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>>(
- rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), std::forward<Coordination>(sf)));
+ -> observable<rxu::value_type_t<rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>>, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>> {
+ return observable<rxu::value_type_t<rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>>, rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>>(
+ rxo::detail::concat_map<this_type, CollectionSelector, ResultSelector, Coordination>(*this, std::forward<CollectionSelector>(s), std::forward<ResultSelector>(rs), std::forward<Coordination>(sf)));
}
template<class Source, class Coordination, class TS, class C = rxu::types_checked>
@@ -1082,9 +1082,9 @@ public:
///
template<class Coordination>
auto subscribe_on(Coordination cn) const
- -> observable<typename rxo::detail::subscribe_on<T, this_type, Coordination>::value_type, rxo::detail::subscribe_on<T, this_type, Coordination>> {
- return observable<typename rxo::detail::subscribe_on<T, this_type, Coordination>::value_type, rxo::detail::subscribe_on<T, this_type, Coordination>>(
- rxo::detail::subscribe_on<T, this_type, Coordination>(*this, std::move(cn)));
+ -> observable<rxu::value_type_t<rxo::detail::subscribe_on<T, this_type, Coordination>>, rxo::detail::subscribe_on<T, this_type, Coordination>> {
+ return observable<rxu::value_type_t<rxo::detail::subscribe_on<T, this_type, Coordination>>, rxo::detail::subscribe_on<T, this_type, Coordination>>(
+ rxo::detail::subscribe_on<T, this_type, Coordination>(*this, std::move(cn)));
}
/// observe_on ->
@@ -1101,9 +1101,9 @@ public:
///
template<class Seed, class Accumulator, class ResultSelector>
auto reduce(Seed seed, Accumulator&& a, ResultSelector&& rs) const
- -> observable<typename rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>::value_type, rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>> {
- return observable<typename rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>::value_type, rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>>(
- rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>(source_operator, std::forward<Accumulator>(a), std::forward<ResultSelector>(rs), seed));
+ -> observable<rxu::value_type_t<rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>>, rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>> {
+ return observable<rxu::value_type_t<rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>>, rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>>(
+ rxo::detail::reduce<T, source_operator_type, Accumulator, ResultSelector, Seed>(source_operator, std::forward<Accumulator>(a), std::forward<ResultSelector>(rs), seed));
}
template<class Seed, class Accumulator, class ResultSelector>
@@ -1315,8 +1315,8 @@ public:
/// take values pairwise from the observable
///
auto pairwise() const
- -> decltype(EXPLICIT_THIS lift<typename rxo::detail::pairwise<T>::value_type>(rxo::detail::pairwise<T>())) {
- return lift<typename rxo::detail::pairwise<T>::value_type>(rxo::detail::pairwise<T>());
+ -> decltype(EXPLICIT_THIS lift<rxu::value_type_t<rxo::detail::pairwise<T>>>(rxo::detail::pairwise<T>())) {
+ return lift<rxu::value_type_t<rxo::detail::pairwise<T>>>(rxo::detail::pairwise<T>());
}
};
@@ -1473,8 +1473,8 @@ public:
}
template<class Observable, class Value0, class... ValueN>
static auto start_with(Observable o, Value0 v0, ValueN... vn)
- -> decltype(rxs::from(typename Observable::value_type(v0), typename Observable::value_type(vn)...).concat(o)) {
- return rxs::from(typename Observable::value_type(v0), typename Observable::value_type(vn)...).concat(o);
+ -> decltype(rxs::from(rxu::value_type_t<Observable>(v0), rxu::value_type_t<Observable>(vn)...).concat(o)) {
+ return rxs::from(rxu::value_type_t<Observable>(v0), rxu::value_type_t<Observable>(vn)...).concat(o);
}
template<class ResourceFactory, class ObservableFactory>
static auto scope(ResourceFactory rf, ObservableFactory of)
diff --git a/Rx/v2/src/rxcpp/rx-observer.hpp b/Rx/v2/src/rxcpp/rx-observer.hpp
index 6fad944..da93bff 100644
--- a/Rx/v2/src/rxcpp/rx-observer.hpp
+++ b/Rx/v2/src/rxcpp/rx-observer.hpp
@@ -44,7 +44,7 @@ struct is_on_next_of
template<class CT, class CF>
static not_void check(...);
- typedef decltype(check<T, typename std::decay<F>::type>(0)) detail_result;
+ typedef decltype(check<T, rxu::decay_t<F>>(0)) detail_result;
static const bool value = std::is_same<detail_result, void>::value;
};
@@ -57,7 +57,7 @@ struct is_on_error
template<class CF>
static not_void check(...);
- static const bool value = std::is_same<decltype(check<typename std::decay<F>::type>(0)), void>::value;
+ static const bool value = std::is_same<decltype(check<rxu::decay_t<F>>(0)), void>::value;
};
template<class F>
@@ -69,7 +69,7 @@ struct is_on_completed
template<class CF>
static not_void check(...);
- static const bool value = std::is_same<decltype(check<typename std::decay<F>::type>(0)), void>::value;
+ static const bool value = std::is_same<decltype(check<rxu::decay_t<F>>(0)), void>::value;
};
}
@@ -79,9 +79,9 @@ class static_observer
{
public:
typedef static_observer<T, OnNext, OnError, OnCompleted> this_type;
- typedef typename std::decay<OnNext>::type on_next_t;
- typedef typename std::decay<OnError>::type on_error_t;
- typedef typename std::decay<OnCompleted>::type on_completed_t;
+ typedef rxu::decay_t<OnNext> on_next_t;
+ typedef rxu::decay_t<OnError> on_error_t;
+ typedef rxu::decay_t<OnCompleted> on_completed_t;
private:
on_next_t onnext;
@@ -224,7 +224,7 @@ template<class T, class I>
class observer : public observer_base<T>
{
typedef observer<T, I> this_type;
- typedef typename std::decay<I>::type inner_t;
+ typedef rxu::decay_t<I> inner_t;
inner_t inner;
@@ -387,7 +387,7 @@ template<class F>
struct maybe_from_result
{
typedef decltype((*(F*)nullptr)()) decl_result_type;
- typedef typename std::decay<decl_result_type>::type result_type;
+ typedef rxu::decay_t<decl_result_type> result_type;
typedef rxu::maybe<result_type> type;
};
diff --git a/Rx/v2/src/rxcpp/rx-operators.hpp b/Rx/v2/src/rxcpp/rx-operators.hpp
index 5e4e042..9d9aec8 100644
--- a/Rx/v2/src/rxcpp/rx-operators.hpp
+++ b/Rx/v2/src/rxcpp/rx-operators.hpp
@@ -26,7 +26,7 @@ class is_operator
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_operator*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_operator*>::value;
};
}
diff --git a/Rx/v2/src/rxcpp/rx-predef.hpp b/Rx/v2/src/rxcpp/rx-predef.hpp
index 634b73f..ebb20ea 100644
--- a/Rx/v2/src/rxcpp/rx-predef.hpp
+++ b/Rx/v2/src/rxcpp/rx-predef.hpp
@@ -37,7 +37,7 @@ class is_worker
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_worker*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_worker*>::value;
};
struct tag_scheduler {};
@@ -50,7 +50,7 @@ class is_scheduler
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_scheduler*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_scheduler*>::value;
};
struct tag_schedulable {};
@@ -63,7 +63,7 @@ class is_schedulable
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_schedulable*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_schedulable*>::value;
};
@@ -82,7 +82,7 @@ class is_observer
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_observer*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_observer*>::value;
};
struct tag_dynamic_observer {};
@@ -95,7 +95,7 @@ class is_dynamic_observer
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_dynamic_observer*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_dynamic_observer*>::value;
};
struct tag_subscriber {};
@@ -108,7 +108,7 @@ class is_subscriber
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_subscriber*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_subscriber*>::value;
};
struct tag_dynamic_observable {};
@@ -121,7 +121,7 @@ class is_dynamic_observable
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_dynamic_observable*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_dynamic_observable*>::value;
};
template<class T>
@@ -153,7 +153,7 @@ class is_observable
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_observable>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_observable>::value;
};
struct tag_dynamic_connectable_observable : public tag_dynamic_observable {};
@@ -167,7 +167,7 @@ class is_dynamic_connectable_observable
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_dynamic_connectable_observable*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_dynamic_connectable_observable*>::value;
};
template<class T>
@@ -187,7 +187,7 @@ class is_connectable_observable
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_connectable_observable>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_connectable_observable>::value;
};
struct tag_dynamic_grouped_observable : public tag_dynamic_observable {};
@@ -201,7 +201,7 @@ class is_dynamic_grouped_observable
template<class C>
static not_void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_dynamic_grouped_observable*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_dynamic_grouped_observable*>::value;
};
template<class K, class T>
@@ -224,7 +224,7 @@ class is_grouped_observable
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_grouped_observable>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_grouped_observable>::value;
};
//
diff --git a/Rx/v2/src/rxcpp/rx-scheduler.hpp b/Rx/v2/src/rxcpp/rx-scheduler.hpp
index f91e66c..bd490fa 100644
--- a/Rx/v2/src/rxcpp/rx-scheduler.hpp
+++ b/Rx/v2/src/rxcpp/rx-scheduler.hpp
@@ -180,7 +180,7 @@ struct is_action_function
template<class CF>
static not_void check(...);
- static const bool value = std::is_same<decltype(check<typename std::decay<F>::type>(0)), void>::value;
+ static const bool value = std::is_same<decltype(check<rxu::decay_t<F>>(0)), void>::value;
};
}
diff --git a/Rx/v2/src/rxcpp/rx-sources.hpp b/Rx/v2/src/rxcpp/rx-sources.hpp
index 25d40ec..7afcf73 100644
--- a/Rx/v2/src/rxcpp/rx-sources.hpp
+++ b/Rx/v2/src/rxcpp/rx-sources.hpp
@@ -27,7 +27,7 @@ class is_source
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_source*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_source*>::value;
};
}
diff --git a/Rx/v2/src/rxcpp/rx-subscriber.hpp b/Rx/v2/src/rxcpp/rx-subscriber.hpp
index 0092637..ad8e5b2 100644
--- a/Rx/v2/src/rxcpp/rx-subscriber.hpp
+++ b/Rx/v2/src/rxcpp/rx-subscriber.hpp
@@ -21,7 +21,7 @@ class subscriber : public subscriber_base<T>
static_assert(!is_subscriber<Observer>::value, "not allowed to nest subscribers");
static_assert(is_observer<Observer>::value, "subscriber must contain an observer<T, ...>");
typedef subscriber<T, Observer> this_type;
- typedef typename std::decay<Observer>::type observer_type;
+ typedef rxu::decay_t<Observer> observer_type;
composite_subscription lifetime;
observer_type destination;
diff --git a/Rx/v2/src/rxcpp/rx-subscription.hpp b/Rx/v2/src/rxcpp/rx-subscription.hpp
index 6263a1f..a5fce21 100644
--- a/Rx/v2/src/rxcpp/rx-subscription.hpp
+++ b/Rx/v2/src/rxcpp/rx-subscription.hpp
@@ -20,7 +20,7 @@ struct is_unsubscribe_function
template<class CF>
static not_void check(...);
- static const bool value = std::is_same<decltype(check<typename std::decay<F>::type>(0)), void>::value;
+ static const bool value = std::is_same<decltype(check<rxu::decay_t<F>>(0)), void>::value;
};
}
@@ -35,13 +35,13 @@ class is_subscription
template<class C>
static void check(...);
public:
- static const bool value = std::is_convertible<decltype(check<typename std::decay<T>::type>(0)), tag_subscription*>::value;
+ static const bool value = std::is_convertible<decltype(check<rxu::decay_t<T>>(0)), tag_subscription*>::value;
};
template<class Unsubscribe>
class static_subscription
{
- typedef typename std::decay<Unsubscribe>::type unsubscribe_call_type;
+ typedef rxu::decay_t<Unsubscribe> unsubscribe_call_type;
unsubscribe_call_type unsubscribe_call;
static_subscription()
{
@@ -86,7 +86,7 @@ private:
template<class I>
struct subscription_state : public base_subscription_state
{
- typedef typename std::decay<I>::type inner_t;
+ typedef rxu::decay_t<I> inner_t;
subscription_state(inner_t i)
: base_subscription_state(true)
, inner(std::move(i))
diff --git a/Rx/v2/src/rxcpp/rx-util.hpp b/Rx/v2/src/rxcpp/rx-util.hpp
index 7b014a4..b2493f3 100644
--- a/Rx/v2/src/rxcpp/rx-util.hpp
+++ b/Rx/v2/src/rxcpp/rx-util.hpp
@@ -40,6 +40,9 @@ namespace rxcpp {
namespace util {
+template<class T> using value_type_t = typename T::value_type;
+template<class T> using decay_t = typename std::decay<T>::type;
+
template<class T, size_t size>
std::vector<T> to_vector(const T (&arr) [size]) {
return std::vector<T>(std::begin(arr), std::end(arr));
@@ -125,8 +128,8 @@ template<class T, class C = types_checked>
struct value_type_from : public std::false_type {typedef types_checked type;};
template<class T>
-struct value_type_from<T, typename types_checked_from<typename T::value_type>::type>
- : public std::true_type {typedef typename T::value_type type;};
+struct value_type_from<T, typename types_checked_from<value_type_t<T>>::type>
+ : public std::true_type {typedef value_type_t<T> type;};
@@ -281,7 +284,7 @@ struct defer_value_type
struct tag_not_valid {typedef void type; static const bool value = false;};
typedef Deferred<typename resolve_type<AN>::type...> resolved_type;
template<class... CN>
- static auto check(int) -> tag_valid<typename resolved_type::value_type>;
+ static auto check(int) -> tag_valid<value_type_t<resolved_type>>;
template<class... CN>
static tag_not_valid check(...);
diff --git a/Rx/v2/src/rxcpp/schedulers/rx-test.hpp b/Rx/v2/src/rxcpp/schedulers/rx-test.hpp
index 331bea9..24a88d9 100644
--- a/Rx/v2/src/rxcpp/schedulers/rx-test.hpp
+++ b/Rx/v2/src/rxcpp/schedulers/rx-test.hpp
@@ -347,7 +347,7 @@ struct is_create_source_function
template<class CF>
static not_void check(...);
- static const bool value = is_observable<decltype(check<typename std::decay<F>::type>(0))>::value;
+ static const bool value = is_observable<decltype(check<rxu::decay_t<F>>(0))>::value;
};
}
@@ -512,21 +512,21 @@ public:
auto start(F createSource, long created, long subscribed, long unsubscribed) const
-> typename std::enable_if<detail::is_create_source_function<F>::value, start_traits<F>>::type::subscriber_type
{
- return start<typename start_traits<F>::value_type>(std::move(createSource), created, subscribed, unsubscribed);
+ return start<rxu::value_type_t<start_traits<F>>>(std::move(createSource), created, subscribed, unsubscribed);
}
template<class F>
auto start(F createSource, long unsubscribed) const
-> typename std::enable_if<detail::is_create_source_function<F>::value, start_traits<F>>::type::subscriber_type
{
- return start<typename start_traits<F>::value_type>(std::move(createSource), created_time, subscribed_time, unsubscribed);
+ return start<rxu::value_type_t<start_traits<F>>>(std::move(createSource), created_time, subscribed_time, unsubscribed);
}
template<class F>
auto start(F createSource) const
-> typename std::enable_if<detail::is_create_source_function<F>::value, start_traits<F>>::type::subscriber_type
{
- return start<typename start_traits<F>::value_type>(std::move(createSource), created_time, subscribed_time, unsubscribed_time);
+ return start<rxu::value_type_t<start_traits<F>>>(std::move(createSource), created_time, subscribed_time, unsubscribed_time);
}
void start() const {
diff --git a/Rx/v2/src/rxcpp/sources/rx-create.hpp b/Rx/v2/src/rxcpp/sources/rx-create.hpp
index 2c50e98..ed27fea 100644
--- a/Rx/v2/src/rxcpp/sources/rx-create.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-create.hpp
@@ -18,7 +18,7 @@ struct create : public source_base<T>
{
typedef create<T, OnSubscribe> this_type;
- typedef typename std::decay<OnSubscribe>::type on_subscribe_type;
+ typedef rxu::decay_t<OnSubscribe> on_subscribe_type;
on_subscribe_type on_subscribe_function;
diff --git a/Rx/v2/src/rxcpp/sources/rx-defer.hpp b/Rx/v2/src/rxcpp/sources/rx-defer.hpp
index 5aef7ef..3afff64 100644
--- a/Rx/v2/src/rxcpp/sources/rx-defer.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-defer.hpp
@@ -16,13 +16,13 @@ namespace detail {
template<class ObservableFactory>
struct defer_traits
{
- typedef typename std::decay<ObservableFactory>::type observable_factory_type;
+ typedef rxu::decay_t<ObservableFactory> observable_factory_type;
typedef decltype((*(observable_factory_type*)nullptr)()) collection_type;
typedef typename collection_type::value_type value_type;
};
template<class ObservableFactory>
-struct defer : public source_base<typename defer_traits<ObservableFactory>::value_type>
+struct defer : public source_base<rxu::value_type_t<defer_traits<ObservableFactory>>>
{
typedef defer<ObservableFactory> this_type;
typedef defer_traits<ObservableFactory> traits;
@@ -54,9 +54,9 @@ struct defer : public source_base<typename defer_traits<ObservableFactory>::valu
template<class ObservableFactory>
auto defer(ObservableFactory of)
- -> observable<typename detail::defer_traits<ObservableFactory>::value_type, detail::defer<ObservableFactory>> {
- return observable<typename detail::defer_traits<ObservableFactory>::value_type, detail::defer<ObservableFactory>>(
- detail::defer<ObservableFactory>(std::move(of)));
+ -> observable<rxu::value_type_t<detail::defer_traits<ObservableFactory>>, detail::defer<ObservableFactory>> {
+ return observable<rxu::value_type_t<detail::defer_traits<ObservableFactory>>, detail::defer<ObservableFactory>>(
+ detail::defer<ObservableFactory>(std::move(of)));
}
}
diff --git a/Rx/v2/src/rxcpp/sources/rx-error.hpp b/Rx/v2/src/rxcpp/sources/rx-error.hpp
index 5014c7c..3f3e07b 100644
--- a/Rx/v2/src/rxcpp/sources/rx-error.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-error.hpp
@@ -18,7 +18,7 @@ struct error : public source_base<T>
{
typedef error<T, Coordination> this_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
@@ -88,13 +88,13 @@ auto make_error(throw_instance_tag&&, E e, Coordination cn)
template<class T, class E>
auto error(E e)
- -> decltype(detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, typename std::decay<E>::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate())) {
- return detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, typename std::decay<E>::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate());
+ -> decltype(detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, rxu::decay_t<E>>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate())) {
+ return detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, rxu::decay_t<E>>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate());
}
template<class T, class E, class Coordination>
auto error(E e, Coordination cn)
- -> decltype(detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, typename std::decay<E>::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn))) {
- return detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, typename std::decay<E>::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn));
+ -> decltype(detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, rxu::decay_t<E>>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn))) {
+ return detail::make_error<T>(typename std::conditional<std::is_same<std::exception_ptr, rxu::decay_t<E>>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn));
}
}
diff --git a/Rx/v2/src/rxcpp/sources/rx-interval.hpp b/Rx/v2/src/rxcpp/sources/rx-interval.hpp
index dade61a..afd5dac 100644
--- a/Rx/v2/src/rxcpp/sources/rx-interval.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-interval.hpp
@@ -18,7 +18,7 @@ struct interval : public source_base<long>
{
typedef interval<Coordination> this_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct interval_initial_type
diff --git a/Rx/v2/src/rxcpp/sources/rx-iterate.hpp b/Rx/v2/src/rxcpp/sources/rx-iterate.hpp
index c78d0a2..be98c0c 100644
--- a/Rx/v2/src/rxcpp/sources/rx-iterate.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-iterate.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class Collection>
struct is_iterable
{
- typedef typename std::decay<Collection>::type collection_type;
+ typedef rxu::decay_t<Collection> collection_type;
struct not_void {};
template<class CC>
@@ -30,18 +30,18 @@ struct is_iterable
template<class Collection>
struct iterate_traits
{
- typedef typename std::decay<Collection>::type collection_type;
+ typedef rxu::decay_t<Collection> collection_type;
typedef decltype(std::begin(*(collection_type*)nullptr)) iterator_type;
- typedef typename std::iterator_traits<iterator_type>::value_type value_type;
+ typedef rxu::value_type_t<std::iterator_traits<iterator_type>> value_type;
};
template<class Collection, class Coordination>
-struct iterate : public source_base<typename iterate_traits<Collection>::value_type>
+struct iterate : public source_base<rxu::value_type_t<iterate_traits<Collection>>>
{
typedef iterate<Collection, Coordination> this_type;
typedef iterate_traits<Collection> traits;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
typedef typename traits::collection_type collection_type;
@@ -134,15 +134,15 @@ struct iterate : public source_base<typename iterate_traits<Collection>::value_t
template<class Collection>
auto iterate(Collection c)
- -> observable<typename detail::iterate_traits<Collection>::value_type, detail::iterate<Collection, identity_one_worker>> {
- return observable<typename detail::iterate_traits<Collection>::value_type, detail::iterate<Collection, identity_one_worker>>(
- detail::iterate<Collection, identity_one_worker>(std::move(c), identity_immediate()));
+ -> observable<rxu::value_type_t<detail::iterate_traits<Collection>>, detail::iterate<Collection, identity_one_worker>> {
+ return observable<rxu::value_type_t<detail::iterate_traits<Collection>>, detail::iterate<Collection, identity_one_worker>>(
+ detail::iterate<Collection, identity_one_worker>(std::move(c), identity_immediate()));
}
template<class Collection, class Coordination>
auto iterate(Collection c, Coordination cn)
- -> observable<typename detail::iterate_traits<Collection>::value_type, detail::iterate<Collection, Coordination>> {
- return observable<typename detail::iterate_traits<Collection>::value_type, detail::iterate<Collection, Coordination>>(
- detail::iterate<Collection, Coordination>(std::move(c), std::move(cn)));
+ -> observable<rxu::value_type_t<detail::iterate_traits<Collection>>, detail::iterate<Collection, Coordination>> {
+ return observable<rxu::value_type_t<detail::iterate_traits<Collection>>, detail::iterate<Collection, Coordination>>(
+ detail::iterate<Collection, Coordination>(std::move(c), std::move(cn)));
}
template<class T>
diff --git a/Rx/v2/src/rxcpp/sources/rx-range.hpp b/Rx/v2/src/rxcpp/sources/rx-range.hpp
index 4af7c24..0be3ae4 100644
--- a/Rx/v2/src/rxcpp/sources/rx-range.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-range.hpp
@@ -16,7 +16,7 @@ namespace detail {
template<class T, class Coordination>
struct range : public source_base<T>
{
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
struct range_state_type
diff --git a/Rx/v2/src/rxcpp/sources/rx-scope.hpp b/Rx/v2/src/rxcpp/sources/rx-scope.hpp
index 1b7a26d..8105ef4 100644
--- a/Rx/v2/src/rxcpp/sources/rx-scope.hpp
+++ b/Rx/v2/src/rxcpp/sources/rx-scope.hpp
@@ -16,8 +16,8 @@ namespace detail {
template<class ResourceFactory, class ObservableFactory>
struct scope_traits
{
- typedef typename std::decay<ResourceFactory>::type resource_factory_type;
- typedef typename std::decay<ObservableFactory>::type observable_factory_type;
+ typedef rxu::decay_t<ResourceFactory> resource_factory_type;
+ typedef rxu::decay_t<ObservableFactory> observable_factory_type;
typedef decltype((*(resource_factory_type*)nullptr)()) resource_type;
typedef decltype((*(observable_factory_type*)nullptr)(resource_type())) collection_type;
typedef typename collection_type::value_type value_type;
@@ -26,7 +26,7 @@ struct scope_traits
};
template<class ResourceFactory, class ObservableFactory>
-struct scope : public source_base<typename scope_traits<ResourceFactory, ObservableFactory>::value_type>
+struct scope : public source_base<rxu::value_type_t<scope_traits<ResourceFactory, ObservableFactory>>>
{
typedef scope_traits<ResourceFactory, ObservableFactory> traits;
typedef typename traits::resource_factory_type resource_factory_type;
@@ -93,9 +93,9 @@ struct scope : public source_base<typename scope_traits<ResourceFactory, Observa
template<class ResourceFactory, class ObservableFactory>
auto scope(ResourceFactory rf, ObservableFactory of)
- -> observable<typename detail::scope_traits<ResourceFactory, ObservableFactory>::value_type, detail::scope<ResourceFactory, ObservableFactory>> {
- return observable<typename detail::scope_traits<ResourceFactory, ObservableFactory>::value_type, detail::scope<ResourceFactory, ObservableFactory>>(
- detail::scope<ResourceFactory, ObservableFactory>(std::move(rf), std::move(of)));
+ -> observable<rxu::value_type_t<detail::scope_traits<ResourceFactory, ObservableFactory>>, detail::scope<ResourceFactory, ObservableFactory>> {
+ return observable<rxu::value_type_t<detail::scope_traits<ResourceFactory, ObservableFactory>>, detail::scope<ResourceFactory, ObservableFactory>>(
+ detail::scope<ResourceFactory, ObservableFactory>(std::move(rf), std::move(of)));
}
}
diff --git a/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp b/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp
index 564f564..25f79cf 100644
--- a/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp
+++ b/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp
@@ -19,7 +19,7 @@ class synchronize_observer : public detail::multicast_observer<T>
typedef synchronize_observer<T, Coordination> this_type;
typedef detail::multicast_observer<T> base_type;
- typedef typename std::decay<Coordination>::type coordination_type;
+ typedef rxu::decay_t<Coordination> coordination_type;
typedef typename coordination_type::coordinator_type coordinator_type;
typedef typename coordinator_type::template get<subscriber<T>>::type output_type;