From 14b0164c5a6ecda8777476f6c27af3bbab1ebd33 Mon Sep 17 00:00:00 2001 From: BenPope Date: Wed, 18 Feb 2015 00:48:16 +0800 Subject: Use type aliases or: How I learned to love the closing chevron --- Rx/v2/src/rxcpp/operators/rx-buffer_count.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-buffer_time.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-buffer_time_count.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-concat.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-concat_map.hpp | 22 +++---- Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp | 8 +-- .../rxcpp/operators/rx-distinct_until_changed.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-filter.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-finally.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-flat_map.hpp | 22 +++---- Rx/v2/src/rxcpp/operators/rx-group_by.hpp | 20 +++--- Rx/v2/src/rxcpp/operators/rx-lift.hpp | 14 ++-- Rx/v2/src/rxcpp/operators/rx-map.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-merge.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-multicast.hpp | 10 +-- Rx/v2/src/rxcpp/operators/rx-observe_on.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-pairwise.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-publish.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-reduce.hpp | 30 ++++----- Rx/v2/src/rxcpp/operators/rx-ref_count.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-repeat.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-retry.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-scan.hpp | 18 +++--- Rx/v2/src/rxcpp/operators/rx-skip.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-skip_until.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-start_with.hpp | 4 +- Rx/v2/src/rxcpp/operators/rx-subscribe.hpp | 4 +- Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-take.hpp | 12 ++-- Rx/v2/src/rxcpp/operators/rx-take_until.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-window.hpp | 8 +-- Rx/v2/src/rxcpp/operators/rx-window_time.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-window_time_count.hpp | 16 ++--- Rx/v2/src/rxcpp/operators/rx-zip.hpp | 16 ++--- Rx/v2/src/rxcpp/rx-connectable_observable.hpp | 4 +- Rx/v2/src/rxcpp/rx-coordination.hpp | 2 +- Rx/v2/src/rxcpp/rx-grouped_observable.hpp | 10 +-- Rx/v2/src/rxcpp/rx-notification.hpp | 2 +- Rx/v2/src/rxcpp/rx-observable.hpp | 74 +++++++++++----------- Rx/v2/src/rxcpp/rx-observer.hpp | 16 ++--- Rx/v2/src/rxcpp/rx-operators.hpp | 2 +- Rx/v2/src/rxcpp/rx-predef.hpp | 24 +++---- Rx/v2/src/rxcpp/rx-scheduler.hpp | 2 +- Rx/v2/src/rxcpp/rx-sources.hpp | 2 +- Rx/v2/src/rxcpp/rx-subscriber.hpp | 2 +- Rx/v2/src/rxcpp/rx-subscription.hpp | 8 +-- Rx/v2/src/rxcpp/rx-util.hpp | 9 ++- Rx/v2/src/rxcpp/schedulers/rx-test.hpp | 8 +-- Rx/v2/src/rxcpp/sources/rx-create.hpp | 2 +- Rx/v2/src/rxcpp/sources/rx-defer.hpp | 10 +-- Rx/v2/src/rxcpp/sources/rx-error.hpp | 10 +-- Rx/v2/src/rxcpp/sources/rx-interval.hpp | 2 +- Rx/v2/src/rxcpp/sources/rx-iterate.hpp | 22 +++---- Rx/v2/src/rxcpp/sources/rx-range.hpp | 2 +- Rx/v2/src/rxcpp/sources/rx-scope.hpp | 12 ++-- Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp | 2 +- 58 files changed, 357 insertions(+), 354 deletions(-) (limited to 'Rx/v2') 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 struct buffer_count { - typedef typename std::decay::type source_value_type; + typedef rxu::decay_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 this_type; typedef std::vector value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer 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 auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(buffer_count::type::value_type>(count, skip))) { - return source.template lift::type::value_type>>(buffer_count::type::value_type>(count, skip)); + -> decltype(source.template lift>>>(buffer_count>>(count, skip))) { + return source.template lift>>>(buffer_count>>(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::value, "Duration parameter must convert to rxsc::scheduler::clock_type::duration"); static_assert(is_coordination::value, "Coordination parameter must satisfy the requirements for a Coordination"); - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; - typedef typename std::decay::type duration_type; + typedef rxu::decay_t duration_type; struct buffer_with_time_values { @@ -48,7 +48,7 @@ struct buffer_with_time { typedef buffer_with_time_observer this_type; typedef std::vector value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; struct buffer_with_time_subscriber_values : public buffer_with_time_values @@ -131,8 +131,8 @@ struct buffer_with_time template class buffer_with_time_factory { - typedef typename std::decay::type duration_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t duration_type; + typedef rxu::decay_t 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 auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(buffer_with_time::type::value_type, Duration, Coordination>(period, skip, coordination))) { - return source.template lift::type::value_type>>(buffer_with_time::type::value_type, Duration, Coordination>(period, skip, coordination)); + -> decltype(source.template lift>>>(buffer_with_time>, Duration, Coordination>(period, skip, coordination))) { + return source.template lift>>>(buffer_with_time>, 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::value, "Duration parameter must convert to rxsc::scheduler::clock_type::duration"); static_assert(is_coordination::value, "Coordination parameter must satisfy the requirements for a Coordination"); - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; - typedef typename std::decay::type duration_type; + typedef rxu::decay_t 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 this_type; typedef std::vector value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer 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 buffer_with_time_or_count_factory { - typedef typename std::decay::type duration_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t duration_type; + typedef rxu::decay_t 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 auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(buffer_with_time_or_count::type::value_type, Duration, Coordination>(period, skip, coordination))) { - return source.template lift::type::value_type>>(buffer_with_time_or_count::type::value_type, Duration, Coordination>(period, skip, coordination)); + -> decltype(source.template lift>>>(buffer_with_time_or_count>, Duration, Coordination>(period, skip, coordination))) { + return source.template lift>>>(buffer_with_time_or_count>, 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 tuple_source_type; typedef std::tuple...> tuple_source_value_type; - typedef typename std::decay::type selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t selector_type; + typedef rxu::decay_t coordination_type; struct tag_not_valid {}; template @@ -34,7 +34,7 @@ struct combine_latest_traits { }; template -struct combine_latest : public operator_base::value_type> +struct combine_latest : public operator_base>> { typedef combine_latest this_type; @@ -179,8 +179,8 @@ struct combine_latest : public operator_base class combine_latest_factory { - typedef typename std::decay::type coordination_type; - typedef typename std::decay::type selector_type; + typedef rxu::decay_t coordination_type; + typedef rxu::decay_t selector_type; typedef std::tuple tuple_source_type; coordination_type coordination; @@ -189,9 +189,9 @@ class combine_latest_factory template auto make(std::tuple source) - -> observable::value_type, combine_latest> { - return observable::value_type, combine_latest>( - combine_latest(coordination, selector, std::move(source))); + -> observable>, combine_latest> { + return observable>, combine_latest>( + combine_latest(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 struct concat - : public operator_base::type::value_type> + : public operator_base>> { typedef concat this_type; - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; @@ -184,7 +184,7 @@ struct concat template class concat_factory { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; coordination_type coordination; public: @@ -195,9 +195,9 @@ public: template auto operator()(Observable source) - -> observable::value_type, concat> { - return observable::value_type, concat>( - concat(std::move(source), coordination)); + -> observable, Observable, Coordination>>, concat, Observable, Coordination>> { + return observable, Observable, Coordination>>, concat, Observable, Coordination>>( + concat, 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 struct concat_traits { - typedef typename std::decay::type source_type; - typedef typename std::decay::type collection_selector_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t collection_selector_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t coordination_type; typedef typename source_type::value_type source_value_type; @@ -50,7 +50,7 @@ struct concat_traits { template struct concat_map - : public operator_base::value_type> + : public operator_base>> { typedef concat_map this_type; typedef concat_traits traits; @@ -241,9 +241,9 @@ private: template class concat_map_factory { - typedef typename std::decay::type collection_selector_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t collection_selector_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t coordination_type; collection_selector_type selectorCollection; result_selector_type selectorResult; @@ -258,9 +258,9 @@ public: template auto operator()(Observable&& source) - -> observable::value_type, concat_map> { - return observable::value_type, concat_map>( - concat_map(std::forward(source), selectorCollection, selectorResult, coordination)); + -> observable>, concat_map> { + return observable>, concat_map>( + concat_map(std::forward(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 struct connect_forever : public operator_base { - typedef typename std::decay::type source_type; + typedef rxu::decay_t source_type; source_type source; @@ -38,9 +38,9 @@ public: connect_forever_factory() {} template auto operator()(Observable&& source) - -> observable::type::value_type, connect_forever::type::value_type, Observable>> { - return observable::type::value_type, connect_forever::type::value_type, Observable>>( - connect_forever::type::value_type, Observable>(std::forward(source))); + -> observable>, connect_forever>, Observable>> { + return observable>, connect_forever>, Observable>>( + connect_forever>, Observable>(std::forward(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 struct distinct_until_changed { - typedef typename std::decay::type source_value_type; + typedef rxu::decay_t source_value_type; template struct distinct_until_changed_observer { typedef distinct_until_changed_observer this_type; typedef source_value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; mutable rxu::detail::maybe remembered; @@ -62,8 +62,8 @@ class distinct_until_changed_factory public: template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>(distinct_until_changed::type>::value_type)) { - return source.template lift::type::value_type>(distinct_until_changed::type>::value_type); + -> decltype(source.template lift>>(distinct_until_changed>::value_type)) { + return source.template lift>>(distinct_until_changed>::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 struct filter { - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type test_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t test_type; test_type test; filter(test_type t) @@ -30,7 +30,7 @@ struct filter { typedef filter_observer this_type; typedef source_value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; test_type test; @@ -73,14 +73,14 @@ struct filter template class filter_factory { - typedef typename std::decay::type test_type; + typedef rxu::decay_t test_type; test_type predicate; public: filter_factory(test_type p) : predicate(std::move(p)) {} template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>(filter::type::value_type, test_type>(predicate))) { - return source.template lift::type::value_type>(filter::type::value_type, test_type>(predicate)); + -> decltype(source.template lift>>(filter>, test_type>(predicate))) { + return source.template lift>>(filter>, 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 struct finally { - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type last_call_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t last_call_type; last_call_type last_call; finally(last_call_type lc) @@ -30,7 +30,7 @@ struct finally { typedef finally_observer this_type; typedef source_value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; @@ -70,14 +70,14 @@ struct finally template class finally_factory { - typedef typename std::decay::type last_call_type; + typedef rxu::decay_t last_call_type; last_call_type last_call; public: finally_factory(last_call_type lc) : last_call(std::move(lc)) {} template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>(filter::type::value_type, last_call_type>(last_call))) { - return source.template lift::type::value_type>(filter::type::value_type, last_call_type>(last_call)); + -> decltype(source.template lift>>(filter>, last_call_type>(last_call))) { + return source.template lift>>(filter>, 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 struct flat_map_traits { - typedef typename std::decay::type source_type; - typedef typename std::decay::type collection_selector_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t collection_selector_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t coordination_type; typedef typename source_type::value_type source_value_type; @@ -48,7 +48,7 @@ struct flat_map_traits { template struct flat_map - : public operator_base::value_type> + : public operator_base>> { typedef flat_map this_type; typedef flat_map_traits traits; @@ -224,9 +224,9 @@ struct flat_map template class flat_map_factory { - typedef typename std::decay::type collection_selector_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t collection_selector_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t coordination_type; collection_selector_type selectorCollection; result_selector_type selectorResult; @@ -241,9 +241,9 @@ public: template auto operator()(Observable&& source) - -> observable::value_type, flat_map> { - return observable::value_type, flat_map>( - flat_map(std::forward(source), selectorCollection, selectorResult, coordination)); + -> observable>, flat_map> { + return observable>, flat_map>( + flat_map(std::forward(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 struct is_group_by_selector_for { - typedef typename std::decay::type selector_type; + typedef rxu::decay_t selector_type; typedef T source_value_type; struct tag_not_valid {}; @@ -33,10 +33,10 @@ template::type source_type; - typedef typename std::decay::type key_selector_type; - typedef typename std::decay::type marble_selector_type; - typedef typename std::decay::type predicate_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t key_selector_type; + typedef rxu::decay_t marble_selector_type; + typedef rxu::decay_t predicate_type; static_assert(is_group_by_selector_for::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 this_type; typedef typename traits_type::grouped_observable_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; @@ -174,9 +174,9 @@ struct group_by template class group_by_factory { - typedef typename std::decay::type key_selector_type; - typedef typename std::decay::type marble_selector_type; - typedef typename std::decay::type predicate_type; + typedef rxu::decay_t key_selector_type; + typedef rxu::decay_t marble_selector_type; + typedef rxu::decay_t predicate_type; key_selector_type keySelector; marble_selector_type marbleSelector; predicate_type predicate; @@ -190,7 +190,7 @@ public: template struct group_by_factory_traits { - typedef typename Observable::value_type value_type; + typedef rxu::value_type_t value_type; typedef detail::group_by_traits traits_type; typedef detail::group_by 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 static tag_not_valid check(...); - typedef typename std::decay::type for_type; - typedef typename std::decay::type func_type; + typedef rxu::decay_t for_type; + typedef rxu::decay_t func_type; typedef decltype(check(0)) detail_result; static const bool value = is_subscriber::value && is_subscriber::value && std::is_convertible::type>::value; }; @@ -35,9 +35,9 @@ namespace detail { template struct lift_traits { - typedef typename std::decay::type result_value_type; - typedef typename std::decay::type source_operator_type; - typedef typename std::decay::type operator_type; + typedef rxu::decay_t result_value_type; + typedef rxu::decay_t source_operator_type; + typedef rxu::decay_t operator_type; typedef typename source_operator_type::value_type source_value_type; @@ -70,7 +70,7 @@ struct lift_operator : public operator_base class lift_factory { - typedef typename std::decay::type operator_type; + typedef rxu::decay_t 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(chain)) { return source.template lift(chain); - static_assert(rxcpp::detail::is_lift_function_for, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber)"); + static_assert(rxcpp::detail::is_lift_function_for, subscriber, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber)"); } }; 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 struct map { - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type select_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t 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 this_type; typedef decltype((*(select_type*)nullptr)(*(source_value_type*)nullptr)) value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; select_type selector; @@ -75,14 +75,14 @@ struct map template class map_factory { - typedef typename std::decay::type select_type; + typedef rxu::decay_t select_type; select_type selector; public: map_factory(select_type s) : selector(std::move(s)) {} template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type, select_type>::value_type>(map::type::value_type, select_type>(selector))) { - return source.template lift::type::value_type, select_type>::value_type>(map::type::value_type, select_type>(selector)); + -> decltype(source.template lift>, select_type>>>(map>, select_type>(selector))) { + return source.template lift>, select_type>>>(map>, 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 struct merge - : public operator_base::type::value_type> + : public operator_base>> { //static_assert(is_observable::value, "merge requires an observable"); //static_assert(is_observable::value, "merge requires an observable that contains observables"); typedef merge this_type; - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type source_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t 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::type coordination_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; struct values @@ -172,7 +172,7 @@ struct merge template class merge_factory { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; coordination_type coordination; public: @@ -183,9 +183,9 @@ public: template auto operator()(Observable source) - -> observable::value_type, merge> { - return observable::value_type, merge>( - merge(std::move(source), coordination)); + -> observable, Observable, Coordination>>, merge, Observable, Coordination>> { + return observable, Observable, Coordination>>, merge, Observable, Coordination>>( + merge, 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 struct multicast : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type subject_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t subject_type; struct multicast_state : public std::enable_shared_from_this { @@ -76,9 +76,9 @@ public: } template auto operator()(Observable&& source) - -> connectable_observable::type::value_type, multicast::type::value_type, Observable, Subject>> { - return connectable_observable::type::value_type, multicast::type::value_type, Observable, Subject>>( - multicast::type::value_type, Observable, Subject>(std::forward(source), caster)); + -> connectable_observable>, multicast>, Observable, Subject>> { + return connectable_observable>, multicast>, Observable, Subject>>( + multicast>, Observable, Subject>(std::forward(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 struct observe_on { - typedef typename std::decay::type source_value_type; + typedef rxu::decay_t source_value_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; coordination_type coordination; @@ -34,7 +34,7 @@ struct observe_on typedef observe_on_observer this_type; typedef observer_base base_type; typedef source_value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; typedef rxn::notification notification_type; @@ -184,14 +184,14 @@ struct observe_on template class observe_on_factory { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; coordination_type coordination; public: observe_on_factory(coordination_type cn) : coordination(std::move(cn)) {} template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>(observe_on::type::value_type, coordination_type>(coordination))) { - return source.template lift::type::value_type>(observe_on::type::value_type, coordination_type>(coordination)); + -> decltype(source.template lift>>(observe_on>, coordination_type>(coordination))) { + return source.template lift>>(observe_on>, 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 struct pairwise { - typedef typename std::decay::type source_value_type; + typedef rxu::decay_t source_value_type; typedef std::tuple value_type; template @@ -24,7 +24,7 @@ struct pairwise { typedef pairwise_observer this_type; typedef std::tuple value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; mutable rxu::detail::maybe remembered; @@ -67,8 +67,8 @@ class pairwise_factory public: template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>::value_type>(pairwise::type::value_type>())) { - return source.template lift::type::value_type>::value_type>(pairwise::type::value_type>()); + -> decltype(source.template lift>>>>(pairwise>>())) { + return source.template lift>>>>(pairwise>>()); } }; 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 auto operator()(Observable&& source) - -> connectable_observable::type::value_type, multicast::type::value_type, Observable, Subject::type::value_type>>> { - return connectable_observable::type::value_type, multicast::type::value_type, Observable, Subject::type::value_type>>>( - multicast::type::value_type, Observable, Subject::type::value_type>>( - std::forward(source), Subject::type::value_type>())); + -> connectable_observable>, multicast>, Observable, Subject>>>> { + return connectable_observable>, multicast>, Observable, Subject>>>>( + multicast>, Observable, Subject>>>( + std::forward(source), Subject>>())); } }; 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 struct is_accumulate_function_for { - typedef typename std::decay::type accumulator_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t accumulator_type; + typedef rxu::decay_t seed_type; typedef T source_value_type; struct tag_not_valid {}; @@ -33,8 +33,8 @@ struct is_accumulate_function_for { template struct is_result_function_for { - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t seed_type; struct tag_not_valid {}; @@ -50,10 +50,10 @@ struct is_result_function_for { template struct reduce_traits { - typedef typename std::decay::type source_type; - typedef typename std::decay::type accumulator_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t accumulator_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t seed_type; typedef T source_value_type; @@ -65,7 +65,7 @@ struct reduce_traits }; template -struct reduce : public operator_base::value_type> +struct reduce : public operator_base>> { typedef reduce this_type; typedef reduce_traits traits; @@ -164,9 +164,9 @@ private: template class reduce_factory { - typedef typename std::decay::type accumulator_type; - typedef typename std::decay::type result_selector_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t accumulator_type; + typedef rxu::decay_t result_selector_type; + typedef rxu::decay_t seed_type; accumulator_type accumulator; result_selector_type result_selector; @@ -180,9 +180,9 @@ public: } template auto operator()(const Observable& source) - -> observable> { - return observable>( - reduce(source.source_operator, accumulator, result_selector, seed)); + -> observable, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>> { + return observable, typename Observable::source_operator_type, Accumulator, ResultSelector, Seed>>( + reduce, 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 struct ref_count : public operator_base { - typedef typename std::decay::type source_type; + typedef rxu::decay_t source_type; struct ref_count_state : public std::enable_shared_from_this { @@ -65,9 +65,9 @@ public: ref_count_factory() {} template auto operator()(Observable&& source) - -> observable::type::value_type, ref_count::type::value_type, Observable>> { - return observable::type::value_type, ref_count::type::value_type, Observable>>( - ref_count::type::value_type, Observable>(std::forward(source))); + -> observable>, ref_count>, Observable>> { + return observable>, ref_count>, Observable>>( + ref_count>, Observable>(std::forward(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 struct repeat : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type count_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t count_type; struct values { values(source_type s, count_type t) @@ -94,16 +94,16 @@ struct repeat : public operator_base template class repeat_factory { - typedef typename std::decay::type count_type; + typedef rxu::decay_t count_type; count_type count; public: repeat_factory(count_type t) : count(std::move(t)) {} template auto operator()(Observable&& source) - -> observable::type::value_type, repeat::type::value_type, Observable, count_type>> { - return observable::type::value_type, repeat::type::value_type, Observable, count_type>>( - repeat::type::value_type, Observable, count_type>(std::forward(source), count)); + -> observable>, repeat>, Observable, count_type>> { + return observable>, repeat>, Observable, count_type>>( + repeat>, Observable, count_type>(std::forward(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 struct retry : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type count_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t count_type; struct values { values(source_type s, count_type t) : source(std::move(s)) @@ -90,16 +90,16 @@ namespace rxcpp { template class retry_factory { - typedef typename std::decay::type count_type; + typedef rxu::decay_t count_type; count_type count; public: retry_factory(count_type t) : count(std::move(t)) {} template auto operator()(Observable&& source) - -> observable::type::value_type, retry::type::value_type, Observable, count_type>> { - return observable::type::value_type, retry::type::value_type, Observable, count_type>>( - retry::type::value_type, Observable, count_type>(std::forward(source), count)); + -> observable>, retry>, Observable, count_type>> { + return observable>, retry>, Observable, count_type>>( + retry>, Observable, count_type>(std::forward(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 -struct scan : public operator_base::type> +struct scan : public operator_base> { - typedef typename std::decay::type source_type; - typedef typename std::decay::type accumulator_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t accumulator_type; + typedef rxu::decay_t seed_type; struct scan_initial_type { @@ -88,8 +88,8 @@ struct scan : public operator_base::type> template class scan_factory { - typedef typename std::decay::type accumulator_type; - typedef typename std::decay::type seed_type; + typedef rxu::decay_t accumulator_type; + typedef rxu::decay_t seed_type; accumulator_type accumulator; seed_type seed; @@ -101,9 +101,9 @@ public: } template auto operator()(Observable&& source) - -> observable::type, scan::type::value_type, Observable, Accumulator, Seed>> { - return observable::type, scan::type::value_type, Observable, Accumulator, Seed>>( - scan::type::value_type, Observable, Accumulator, Seed>(std::forward(source), accumulator, seed)); + -> observable, scan>, Observable, Accumulator, Seed>> { + return observable, scan>, Observable, Accumulator, Seed>>( + scan>, Observable, Accumulator, Seed>(std::forward(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 struct skip : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type count_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t count_type; struct values { values(source_type s, count_type t) @@ -99,15 +99,15 @@ struct skip : public operator_base template class skip_factory { - typedef typename std::decay::type count_type; + typedef rxu::decay_t count_type; count_type count; public: skip_factory(count_type t) : count(std::move(t)) {} template auto operator()(Observable&& source) - -> observable::type::value_type, skip::type::value_type, Observable, count_type>> { - return observable::type::value_type, skip::type::value_type, Observable, count_type>>( - skip::type::value_type, Observable, count_type>(std::forward(source), count)); + -> observable>, skip>, Observable, count_type>> { + return observable>, skip>, Observable, count_type>>( + skip>, Observable, count_type>(std::forward(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 struct skip_until : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type trigger_source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t trigger_source_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; struct values { @@ -164,8 +164,8 @@ struct skip_until : public operator_base template class skip_until_factory { - typedef typename std::decay::type trigger_source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t trigger_source_type; + typedef rxu::decay_t coordination_type; trigger_source_type trigger_source; coordination_type coordination; @@ -177,9 +177,9 @@ public: } template auto operator()(Observable&& source) - -> observable::type::value_type, skip_until::type::value_type, Observable, trigger_source_type, Coordination>> { - return observable::type::value_type, skip_until::type::value_type, Observable, trigger_source_type, Coordination>>( - skip_until::type::value_type, Observable, trigger_source_type, Coordination>(std::forward(source), trigger_source, coordination)); + -> observable>, skip_until>, Observable, trigger_source_type, Coordination>> { + return observable>, skip_until>, Observable, trigger_source_type, Coordination>>( + skip_until>, Observable, trigger_source_type, Coordination>(std::forward(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 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(v0), rxu::value_type_t(vn)...).concat(o)) { + return rxs::from(rxu::value_type_t(v0), rxu::value_type_t(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 auto operator()(Observable&& source) - -> observable::type::value_type> { - return observable::type::value_type>(std::forward(source)); + -> observable>> { + return observable>>(std::forward(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 struct subscribe_on : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; struct subscribe_on_values { @@ -110,7 +110,7 @@ private: template class subscribe_on_factory { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; coordination_type coordination; public: @@ -120,9 +120,9 @@ public: } template auto operator()(Observable&& source) - -> observable::type::value_type, subscribe_on::type::value_type, Observable, Coordination>> { - return observable::type::value_type, subscribe_on::type::value_type, Observable, Coordination>>( - subscribe_on::type::value_type, Observable, Coordination>(std::forward(source), coordination)); + -> observable>, subscribe_on>, Observable, Coordination>> { + return observable>, subscribe_on>, Observable, Coordination>>( + subscribe_on>, Observable, Coordination>(std::forward(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 struct switch_on_next - : public operator_base::type::value_type> + : public operator_base>> { //static_assert(is_observable::value, "switch_on_next requires an observable"); //static_assert(is_observable::value, "switch_on_next requires an observable that contains observables"); typedef switch_on_next this_type; - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type source_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t 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::type coordination_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; struct values @@ -183,7 +183,7 @@ struct switch_on_next template class switch_on_next_factory { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; coordination_type coordination; public: @@ -194,9 +194,9 @@ public: template auto operator()(Observable source) - -> observable::value_type, switch_on_next> { - return observable::value_type, switch_on_next>( - switch_on_next(std::move(source), coordination)); + -> observable, Observable, Coordination>>, switch_on_next, Observable, Coordination>> { + return observable, Observable, Coordination>>, switch_on_next, Observable, Coordination>>( + switch_on_next, 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 struct take : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type count_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t count_type; struct values { values(source_type s, count_type t) @@ -103,15 +103,15 @@ struct take : public operator_base template class take_factory { - typedef typename std::decay::type count_type; + typedef rxu::decay_t count_type; count_type count; public: take_factory(count_type t) : count(std::move(t)) {} template auto operator()(Observable&& source) - -> observable::type::value_type, take::type::value_type, Observable, count_type>> { - return observable::type::value_type, take::type::value_type, Observable, count_type>>( - take::type::value_type, Observable, count_type>(std::forward(source), count)); + -> observable>, take>, Observable, count_type>> { + return observable>, take>, Observable, count_type>>( + take>, Observable, count_type>(std::forward(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 struct take_until : public operator_base { - typedef typename std::decay::type source_type; - typedef typename std::decay::type trigger_source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t trigger_source_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; struct values { @@ -162,8 +162,8 @@ struct take_until : public operator_base template class take_until_factory { - typedef typename std::decay::type trigger_source_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t trigger_source_type; + typedef rxu::decay_t coordination_type; trigger_source_type trigger_source; coordination_type coordination; @@ -175,9 +175,9 @@ public: } template auto operator()(Observable&& source) - -> observable::type::value_type, take_until::type::value_type, Observable, trigger_source_type, Coordination>> { - return observable::type::value_type, take_until::type::value_type, Observable, trigger_source_type, Coordination>>( - take_until::type::value_type, Observable, trigger_source_type, Coordination>(std::forward(source), trigger_source, coordination)); + -> observable>, take_until>, Observable, trigger_source_type, Coordination>> { + return observable>, take_until>, Observable, trigger_source_type, Coordination>>( + take_until>, Observable, trigger_source_type, Coordination>(std::forward(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 struct window { - typedef typename std::decay::type source_value_type; + typedef rxu::decay_t source_value_type; struct window_values { window_values(int c, int s) @@ -41,7 +41,7 @@ struct window typedef window_observer this_type; typedef observer_base> base_type; typedef typename base_type::value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; dest_type dest; mutable int cursor; @@ -107,8 +107,8 @@ public: window_factory(int c, int s) : count(c), skip(s) {} template auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(window::type::value_type>(count, skip))) { - return source.template lift::type::value_type>>(window::type::value_type>(count, skip)); + -> decltype(source.template lift>>>(window>>(count, skip))) { + return source.template lift>>>(window>>(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 struct window_with_time { - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; - typedef typename std::decay::type duration_type; + typedef rxu::decay_t duration_type; struct window_with_time_values { @@ -46,7 +46,7 @@ struct window_with_time typedef window_with_time_observer this_type; typedef observer_base> base_type; typedef typename base_type::value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer observer_type; struct window_with_time_subscriber_values : public window_with_time_values @@ -128,8 +128,8 @@ struct window_with_time template class window_with_time_factory { - typedef typename std::decay::type duration_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t duration_type; + typedef rxu::decay_t 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 auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(window_with_time::type::value_type, Duration, Coordination>(period, skip, coordination))) { - return source.template lift::type::value_type>>(window_with_time::type::value_type, Duration, Coordination>(period, skip, coordination)); + -> decltype(source.template lift>>>(window_with_time>, Duration, Coordination>(period, skip, coordination))) { + return source.template lift>>>(window_with_time>, 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 struct window_with_time_or_count { - typedef typename std::decay::type source_value_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t source_value_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; - typedef typename std::decay::type duration_type; + typedef rxu::decay_t 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 this_type; typedef observer_base> base_type; typedef typename base_type::value_type value_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef observer 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 window_with_time_or_count_factory { - typedef typename std::decay::type duration_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t duration_type; + typedef rxu::decay_t 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 auto operator()(Observable&& source) - -> decltype(source.template lift::type::value_type>>(window_with_time_or_count::type::value_type, Duration, Coordination>(period, count, coordination))) { - return source.template lift::type::value_type>>(window_with_time_or_count::type::value_type, Duration, Coordination>(period, count, coordination)); + -> decltype(source.template lift>>>(window_with_time_or_count>, Duration, Coordination>(period, count, coordination))) { + return source.template lift>>>(window_with_time_or_count>, 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 tuple_source_type; typedef std::tuple...> tuple_source_values_type; - typedef typename std::decay::type selector_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t selector_type; + typedef rxu::decay_t coordination_type; struct tag_not_valid {}; template @@ -33,7 +33,7 @@ struct zip_traits { }; template -struct zip : public operator_base::value_type> +struct zip : public operator_base>> { typedef zip this_type; @@ -171,8 +171,8 @@ struct zip : public operator_base class zip_factory { - typedef typename std::decay::type coordination_type; - typedef typename std::decay::type selector_type; + typedef rxu::decay_t coordination_type; + typedef rxu::decay_t selector_type; typedef std::tuple tuple_source_type; coordination_type coordination; @@ -181,9 +181,9 @@ class zip_factory template auto make(std::tuple source) - -> observable::value_type, zip> { - return observable::value_type, zip>( - zip(coordination, selector, std::move(source))); + -> observable>, zip> { + return observable>, zip>( + zip(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 void construct(SO&& source, rxs::tag_source&&) { - auto so = std::make_shared::type>(std::forward(source)); + auto so = std::make_shared>(std::forward(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 this_type; typedef observable base_type; - typedef typename std::decay::type source_operator_type; + typedef rxu::decay_t source_operator_type; static_assert(detail::has_on_connect::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 this_type; - typedef typename std::decay::type dest_type; + typedef rxu::decay_t dest_type; typedef typename dest_type::value_type value_type; typedef observer 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(0)) detail_result; - static const bool value = std::is_same::type>::value; + static const bool value = std::is_same>::value; }; } @@ -31,7 +31,7 @@ class dynamic_grouped_observable : public dynamic_observable { public: - typedef typename std::decay::type key_type; + typedef rxu::decay_t key_type; typedef tag_dynamic_grouped_observable dynamic_observable_tag; private: @@ -59,7 +59,7 @@ private: template void construct(SO&& source, const rxs::tag_source&) { - auto so = std::make_shared::type>(std::forward(source)); + auto so = std::make_shared>(std::forward(source)); state->on_get_key = [so]() mutable { return so->on_get_key(); }; @@ -117,12 +117,12 @@ class grouped_observable { typedef grouped_observable this_type; typedef observable base_type; - typedef typename std::decay::type source_operator_type; + typedef rxu::decay_t source_operator_type; static_assert(detail::has_on_get_key_for::value, "inner must have on_get_key method key_type()"); public: - typedef typename std::decay::type key_type; + typedef rxu::decay_t 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 type operator()(Exception&& e) const { return make_on_error(typename std::conditional< - std::is_same::type, std::exception_ptr>::value, + std::is_same, std::exception_ptr>::value, exception_ptr_tag, exception_tag>::type(), std::forward(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 static not_void check(...); - typedef typename std::decay::type source_type; - typedef typename std::decay::type function_type; + typedef rxu::decay_t source_type; + typedef rxu::decay_t function_type; typedef decltype(check(0)) detail_result; static const bool value = !std::is_same::value && is_observable::value; @@ -42,7 +42,7 @@ struct has_on_subscribe_for template static not_void check(...); - typedef decltype(check::type, T>(0)) detail_result; + typedef decltype(check, T>(0)) detail_result; static const bool value = std::is_same::value; }; @@ -66,7 +66,7 @@ class dynamic_observable template void construct(SO&& source, rxs::tag_source&&) { - typename std::decay::type so = std::forward(source); + rxu::decay_t so = std::forward(source); state->on_subscribe = [so](subscriber o) mutable { so.on_subscribe(std::move(o)); }; @@ -234,7 +234,7 @@ class blocking_observable } public: - typedef typename std::decay::type observable_type; + typedef rxu::decay_t observable_type; observable_type source; ~blocking_observable() { @@ -296,7 +296,7 @@ class observable typedef observable this_type; public: - typedef typename std::decay::type source_operator_type; + typedef rxu::decay_t 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::type subscriber_type; + typedef rxu::decay_t subscriber_type; static_assert(is_subscriber::value, "subscribe must be passed a subscriber"); static_assert(std::is_same::value && std::is_convertible::value, "the value types in the sequence must match or be convertible"); @@ -426,9 +426,9 @@ public: /// template auto lift(Operator&& op) const - -> observable::value_type, rxo::detail::lift_operator> { - return observable::value_type, rxo::detail::lift_operator>( - rxo::detail::lift_operator(source_operator, std::forward(op))); + -> observable>, rxo::detail::lift_operator> { + return observable>, rxo::detail::lift_operator>( + rxo::detail::lift_operator(source_operator, std::forward(op))); static_assert(detail::is_lift_function_for, Operator>::value, "Function passed for lift() must have the signature subscriber<...>(subscriber)"); } @@ -440,9 +440,9 @@ public: template auto lift_if(Operator&& op) const -> typename std::enable_if, Operator>::value, - observable::value_type, rxo::detail::lift_operator>>::type { - return observable::value_type, rxo::detail::lift_operator>( - rxo::detail::lift_operator(source_operator, std::forward(op))); + observable>, rxo::detail::lift_operator>>::type { + return observable>, rxo::detail::lift_operator>( + rxo::detail::lift_operator(source_operator, std::forward(op))); } /// /// takes any function that will take a subscriber for this observable and produce a subscriber. @@ -494,8 +494,8 @@ public: /// template auto map(Selector s) const - -> decltype(EXPLICIT_THIS lift::value_type>(rxo::detail::map(std::move(s)))) { - return lift::value_type>(rxo::detail::map(std::move(s))); + -> decltype(EXPLICIT_THIS lift>>(rxo::detail::map(std::move(s)))) { + return lift>>(rxo::detail::map(std::move(s))); } /// distinct_until_changed -> @@ -747,9 +747,9 @@ public: /// template auto flat_map(CollectionSelector&& s, ResultSelector&& rs) const - -> observable::value_type, rxo::detail::flat_map> { - return observable::value_type, rxo::detail::flat_map>( - rxo::detail::flat_map(*this, std::forward(s), std::forward(rs), identity_current_thread())); + -> observable>, rxo::detail::flat_map> { + return observable>, rxo::detail::flat_map>( + rxo::detail::flat_map(*this, std::forward(s), std::forward(rs), identity_current_thread())); } /// flat_map (AKA SelectMany) -> @@ -759,9 +759,9 @@ public: /// template auto flat_map(CollectionSelector&& s, ResultSelector&& rs, Coordination&& sf) const - -> observable::value_type, rxo::detail::flat_map> { - return observable::value_type, rxo::detail::flat_map>( - rxo::detail::flat_map(*this, std::forward(s), std::forward(rs), std::forward(sf))); + -> observable>, rxo::detail::flat_map> { + return observable>, rxo::detail::flat_map>( + rxo::detail::flat_map(*this, std::forward(s), std::forward(rs), std::forward(sf))); } template @@ -838,9 +838,9 @@ public: /// template auto concat_map(CollectionSelector&& s, ResultSelector&& rs) const - -> observable::value_type, rxo::detail::concat_map> { - return observable::value_type, rxo::detail::concat_map>( - rxo::detail::concat_map(*this, std::forward(s), std::forward(rs), identity_current_thread())); + -> observable>, rxo::detail::concat_map> { + return observable>, rxo::detail::concat_map>( + rxo::detail::concat_map(*this, std::forward(s), std::forward(rs), identity_current_thread())); } /// concat_map -> @@ -850,9 +850,9 @@ public: /// template auto concat_map(CollectionSelector&& s, ResultSelector&& rs, Coordination&& sf) const - -> observable::value_type, rxo::detail::concat_map> { - return observable::value_type, rxo::detail::concat_map>( - rxo::detail::concat_map(*this, std::forward(s), std::forward(rs), std::forward(sf))); + -> observable>, rxo::detail::concat_map> { + return observable>, rxo::detail::concat_map>( + rxo::detail::concat_map(*this, std::forward(s), std::forward(rs), std::forward(sf))); } template @@ -1082,9 +1082,9 @@ public: /// template auto subscribe_on(Coordination cn) const - -> observable::value_type, rxo::detail::subscribe_on> { - return observable::value_type, rxo::detail::subscribe_on>( - rxo::detail::subscribe_on(*this, std::move(cn))); + -> observable>, rxo::detail::subscribe_on> { + return observable>, rxo::detail::subscribe_on>( + rxo::detail::subscribe_on(*this, std::move(cn))); } /// observe_on -> @@ -1101,9 +1101,9 @@ public: /// template auto reduce(Seed seed, Accumulator&& a, ResultSelector&& rs) const - -> observable::value_type, rxo::detail::reduce> { - return observable::value_type, rxo::detail::reduce>( - rxo::detail::reduce(source_operator, std::forward(a), std::forward(rs), seed)); + -> observable>, rxo::detail::reduce> { + return observable>, rxo::detail::reduce>( + rxo::detail::reduce(source_operator, std::forward(a), std::forward(rs), seed)); } template @@ -1315,8 +1315,8 @@ public: /// take values pairwise from the observable /// auto pairwise() const - -> decltype(EXPLICIT_THIS lift::value_type>(rxo::detail::pairwise())) { - return lift::value_type>(rxo::detail::pairwise()); + -> decltype(EXPLICIT_THIS lift>>(rxo::detail::pairwise())) { + return lift>>(rxo::detail::pairwise()); } }; @@ -1473,8 +1473,8 @@ public: } template 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(v0), rxu::value_type_t(vn)...).concat(o)) { + return rxs::from(rxu::value_type_t(v0), rxu::value_type_t(vn)...).concat(o); } template 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 static not_void check(...); - typedef decltype(check::type>(0)) detail_result; + typedef decltype(check>(0)) detail_result; static const bool value = std::is_same::value; }; @@ -57,7 +57,7 @@ struct is_on_error template static not_void check(...); - static const bool value = std::is_same::type>(0)), void>::value; + static const bool value = std::is_same>(0)), void>::value; }; template @@ -69,7 +69,7 @@ struct is_on_completed template static not_void check(...); - static const bool value = std::is_same::type>(0)), void>::value; + static const bool value = std::is_same>(0)), void>::value; }; } @@ -79,9 +79,9 @@ class static_observer { public: typedef static_observer this_type; - typedef typename std::decay::type on_next_t; - typedef typename std::decay::type on_error_t; - typedef typename std::decay::type on_completed_t; + typedef rxu::decay_t on_next_t; + typedef rxu::decay_t on_error_t; + typedef rxu::decay_t on_completed_t; private: on_next_t onnext; @@ -224,7 +224,7 @@ template class observer : public observer_base { typedef observer this_type; - typedef typename std::decay::type inner_t; + typedef rxu::decay_t inner_t; inner_t inner; @@ -387,7 +387,7 @@ template struct maybe_from_result { typedef decltype((*(F*)nullptr)()) decl_result_type; - typedef typename std::decay::type result_type; + typedef rxu::decay_t result_type; typedef rxu::maybe 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 static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_operator*>::value; + static const bool value = std::is_convertible>(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 static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_worker*>::value; + static const bool value = std::is_convertible>(0)), tag_worker*>::value; }; struct tag_scheduler {}; @@ -50,7 +50,7 @@ class is_scheduler template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_scheduler*>::value; + static const bool value = std::is_convertible>(0)), tag_scheduler*>::value; }; struct tag_schedulable {}; @@ -63,7 +63,7 @@ class is_schedulable template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_schedulable*>::value; + static const bool value = std::is_convertible>(0)), tag_schedulable*>::value; }; @@ -82,7 +82,7 @@ class is_observer template static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_observer*>::value; + static const bool value = std::is_convertible>(0)), tag_observer*>::value; }; struct tag_dynamic_observer {}; @@ -95,7 +95,7 @@ class is_dynamic_observer template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_dynamic_observer*>::value; + static const bool value = std::is_convertible>(0)), tag_dynamic_observer*>::value; }; struct tag_subscriber {}; @@ -108,7 +108,7 @@ class is_subscriber template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_subscriber*>::value; + static const bool value = std::is_convertible>(0)), tag_subscriber*>::value; }; struct tag_dynamic_observable {}; @@ -121,7 +121,7 @@ class is_dynamic_observable template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_dynamic_observable*>::value; + static const bool value = std::is_convertible>(0)), tag_dynamic_observable*>::value; }; template @@ -153,7 +153,7 @@ class is_observable template static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_observable>::value; + static const bool value = std::is_convertible>(0)), tag_observable>::value; }; struct tag_dynamic_connectable_observable : public tag_dynamic_observable {}; @@ -167,7 +167,7 @@ class is_dynamic_connectable_observable template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_dynamic_connectable_observable*>::value; + static const bool value = std::is_convertible>(0)), tag_dynamic_connectable_observable*>::value; }; template @@ -187,7 +187,7 @@ class is_connectable_observable template static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_connectable_observable>::value; + static const bool value = std::is_convertible>(0)), tag_connectable_observable>::value; }; struct tag_dynamic_grouped_observable : public tag_dynamic_observable {}; @@ -201,7 +201,7 @@ class is_dynamic_grouped_observable template static not_void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_dynamic_grouped_observable*>::value; + static const bool value = std::is_convertible>(0)), tag_dynamic_grouped_observable*>::value; }; template @@ -224,7 +224,7 @@ class is_grouped_observable template static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_grouped_observable>::value; + static const bool value = std::is_convertible>(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 static not_void check(...); - static const bool value = std::is_same::type>(0)), void>::value; + static const bool value = std::is_same>(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 static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_source*>::value; + static const bool value = std::is_convertible>(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 static_assert(!is_subscriber::value, "not allowed to nest subscribers"); static_assert(is_observer::value, "subscriber must contain an observer"); typedef subscriber this_type; - typedef typename std::decay::type observer_type; + typedef rxu::decay_t 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 static not_void check(...); - static const bool value = std::is_same::type>(0)), void>::value; + static const bool value = std::is_same>(0)), void>::value; }; } @@ -35,13 +35,13 @@ class is_subscription template static void check(...); public: - static const bool value = std::is_convertible::type>(0)), tag_subscription*>::value; + static const bool value = std::is_convertible>(0)), tag_subscription*>::value; }; template class static_subscription { - typedef typename std::decay::type unsubscribe_call_type; + typedef rxu::decay_t unsubscribe_call_type; unsubscribe_call_type unsubscribe_call; static_subscription() { @@ -86,7 +86,7 @@ private: template struct subscription_state : public base_subscription_state { - typedef typename std::decay::type inner_t; + typedef rxu::decay_t 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 using value_type_t = typename T::value_type; +template using decay_t = typename std::decay::type; + template std::vector to_vector(const T (&arr) [size]) { return std::vector(std::begin(arr), std::end(arr)); @@ -125,8 +128,8 @@ template struct value_type_from : public std::false_type {typedef types_checked type;}; template -struct value_type_from::type> - : public std::true_type {typedef typename T::value_type type;}; +struct value_type_from>::type> + : public std::true_type {typedef value_type_t type;}; @@ -281,7 +284,7 @@ struct defer_value_type struct tag_not_valid {typedef void type; static const bool value = false;}; typedef Deferred::type...> resolved_type; template - static auto check(int) -> tag_valid; + static auto check(int) -> tag_valid>; template 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 static not_void check(...); - static const bool value = is_observable::type>(0))>::value; + static const bool value = is_observable>(0))>::value; }; } @@ -512,21 +512,21 @@ public: auto start(F createSource, long created, long subscribed, long unsubscribed) const -> typename std::enable_if::value, start_traits>::type::subscriber_type { - return start::value_type>(std::move(createSource), created, subscribed, unsubscribed); + return start>>(std::move(createSource), created, subscribed, unsubscribed); } template auto start(F createSource, long unsubscribed) const -> typename std::enable_if::value, start_traits>::type::subscriber_type { - return start::value_type>(std::move(createSource), created_time, subscribed_time, unsubscribed); + return start>>(std::move(createSource), created_time, subscribed_time, unsubscribed); } template auto start(F createSource) const -> typename std::enable_if::value, start_traits>::type::subscriber_type { - return start::value_type>(std::move(createSource), created_time, subscribed_time, unsubscribed_time); + return start>>(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 { typedef create this_type; - typedef typename std::decay::type on_subscribe_type; + typedef rxu::decay_t 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 struct defer_traits { - typedef typename std::decay::type observable_factory_type; + typedef rxu::decay_t observable_factory_type; typedef decltype((*(observable_factory_type*)nullptr)()) collection_type; typedef typename collection_type::value_type value_type; }; template -struct defer : public source_base::value_type> +struct defer : public source_base>> { typedef defer this_type; typedef defer_traits traits; @@ -54,9 +54,9 @@ struct defer : public source_base::valu template auto defer(ObservableFactory of) - -> observable::value_type, detail::defer> { - return observable::value_type, detail::defer>( - detail::defer(std::move(of))); + -> observable>, detail::defer> { + return observable>, detail::defer>( + detail::defer(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 { typedef error this_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t 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 auto error(E e) - -> decltype(detail::make_error(typename std::conditional::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate())) { - return detail::make_error(typename std::conditional::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate()); + -> decltype(detail::make_error(typename std::conditional>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate())) { + return detail::make_error(typename std::conditional>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), identity_immediate()); } template auto error(E e, Coordination cn) - -> decltype(detail::make_error(typename std::conditional::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn))) { - return detail::make_error(typename std::conditional::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn)); + -> decltype(detail::make_error(typename std::conditional>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::move(e), std::move(cn))) { + return detail::make_error(typename std::conditional>::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 { typedef interval this_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t 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 struct is_iterable { - typedef typename std::decay::type collection_type; + typedef rxu::decay_t collection_type; struct not_void {}; template @@ -30,18 +30,18 @@ struct is_iterable template struct iterate_traits { - typedef typename std::decay::type collection_type; + typedef rxu::decay_t collection_type; typedef decltype(std::begin(*(collection_type*)nullptr)) iterator_type; - typedef typename std::iterator_traits::value_type value_type; + typedef rxu::value_type_t> value_type; }; template -struct iterate : public source_base::value_type> +struct iterate : public source_base>> { typedef iterate this_type; typedef iterate_traits traits; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t 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::value_t template auto iterate(Collection c) - -> observable::value_type, detail::iterate> { - return observable::value_type, detail::iterate>( - detail::iterate(std::move(c), identity_immediate())); + -> observable>, detail::iterate> { + return observable>, detail::iterate>( + detail::iterate(std::move(c), identity_immediate())); } template auto iterate(Collection c, Coordination cn) - -> observable::value_type, detail::iterate> { - return observable::value_type, detail::iterate>( - detail::iterate(std::move(c), std::move(cn))); + -> observable>, detail::iterate> { + return observable>, detail::iterate>( + detail::iterate(std::move(c), std::move(cn))); } template 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 struct range : public source_base { - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t 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 struct scope_traits { - typedef typename std::decay::type resource_factory_type; - typedef typename std::decay::type observable_factory_type; + typedef rxu::decay_t resource_factory_type; + typedef rxu::decay_t 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 -struct scope : public source_base::value_type> +struct scope : public source_base>> { typedef scope_traits traits; typedef typename traits::resource_factory_type resource_factory_type; @@ -93,9 +93,9 @@ struct scope : public source_base auto scope(ResourceFactory rf, ObservableFactory of) - -> observable::value_type, detail::scope> { - return observable::value_type, detail::scope>( - detail::scope(std::move(rf), std::move(of))); + -> observable>, detail::scope> { + return observable>, detail::scope>( + detail::scope(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 typedef synchronize_observer this_type; typedef detail::multicast_observer base_type; - typedef typename std::decay::type coordination_type; + typedef rxu::decay_t coordination_type; typedef typename coordination_type::coordinator_type coordinator_type; typedef typename coordinator_type::template get>::type output_type; -- cgit v1.2.3