Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/v4.1.1.compiler errors #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-amb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ struct amb
typedef Subscriber output_type;

struct amb_state_type
: public std::enable_shared_from_this<amb_state_type>
, public values
: public values
{
amb_state_type(values i, coordinator_type coor, output_type oarg)
: values(i)
Expand Down
7 changes: 2 additions & 5 deletions Rx/v2/src/rxcpp/operators/rx-combine_latest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ struct combine_latest : public operator_base<rxu::value_type_t<combine_latest_tr
value.reset(st);

if (state->valuesSet == sizeof... (ObservableN)) {
auto values = rxu::surely(state->latest);
auto selectedResult = rxu::apply(values, state->selector);
state->out.on_next(selectedResult);
state->out.on_next(rxu::apply(rxu::surely(state->latest), state->selector));
}
},
// on_error
Expand Down Expand Up @@ -204,8 +202,7 @@ struct combine_latest : public operator_base<rxu::value_type_t<combine_latest_tr
typedef Subscriber output_type;

struct combine_latest_state_type
: public std::enable_shared_from_this<combine_latest_state_type>
, public values
: public values
{
combine_latest_state_type(values i, coordinator_type coor, output_type oarg)
: values(std::move(i))
Expand Down
5 changes: 5 additions & 0 deletions Rx/v2/src/rxcpp/operators/rx-concat_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ struct concat_map
, coordination(std::move(sf))
{
}
values(values const& o) = default;
values(values&& o) = default;
source_type source;
collection_selector_type selectCollection;
result_selector_type selectResult;
Expand All @@ -125,6 +127,9 @@ struct concat_map
{
}

concat_map(concat_map const& o) = default;
concat_map(concat_map&& o) = default;

template<class Subscriber>
void on_subscribe(Subscriber scbr) const {
static_assert(is_subscriber<Subscriber>::value, "subscribe must be passed a subscriber");
Expand Down
6 changes: 2 additions & 4 deletions Rx/v2/src/rxcpp/operators/rx-flat_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ struct flat_map
typedef Subscriber output_type;

struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(values i, coordinator_type coor, output_type oarg)
: values(std::move(i))
Expand Down Expand Up @@ -194,8 +193,7 @@ struct flat_map
innercs,
// on_next
[state, st](collection_value_type ct) {
auto selectedResult = state->selectResult(st, std::move(ct));
state->out.on_next(std::move(selectedResult));
state->out.on_next(state->selectResult(st, std::move(ct)));
},
// on_error
[state](rxu::error_ptr e) {
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-merge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ struct merge
typedef Subscriber output_type;

struct merge_state_type
: public std::enable_shared_from_this<merge_state_type>
, public values
: public values
{
merge_state_type(values i, coordinator_type coor, output_type oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-merge_delay_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ struct merge_delay_error
typedef Subscriber output_type;

struct merge_state_type
: public std::enable_shared_from_this<merge_state_type>
, public values
: public values
{
merge_state_type(values i, coordinator_type coor, output_type oarg)
: values(i)
Expand Down
2 changes: 1 addition & 1 deletion Rx/v2/src/rxcpp/operators/rx-multicast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct multicast : public operator_base<T>
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>
struct multicast_state
{
multicast_state(source_type o, subject_type sub)
: source(std::move(o))
Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/operators/rx-reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ struct reduce : public operator_base<rxu::value_type_t<reduce_traits<T, Observab
void on_subscribe(Subscriber o) const {
struct reduce_state_type
: public reduce_initial_type
, public std::enable_shared_from_this<reduce_state_type>
{
reduce_state_type(reduce_initial_type i, Subscriber scrbr)
: reduce_initial_type(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-ref_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ struct ref_count : public operator_base<T>
// removed constexpr to support older VC compilers
static /*constexpr */ const bool has_observable_v = has_observable_t::value;

struct ref_count_state : public std::enable_shared_from_this<ref_count_state>,
public ref_count_state_base<ConnectableObservable, Observable>
struct ref_count_state : public ref_count_state_base<ConnectableObservable, Observable>
{
template <class HasObservable = has_observable_t,
class Enabled = rxu::enable_if_all_true_type_t<
Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/operators/rx-scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct scan : public operator_base<rxu::decay_t<Seed>>
void on_subscribe(Subscriber o) const {
struct scan_state_type
: public scan_initial_type
, public std::enable_shared_from_this<scan_state_type>
{
scan_state_type(scan_initial_type i, Subscriber scrbr)
: scan_initial_type(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-sequence_equal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ struct sequence_equal : public operator_base<bool>
typedef Subscriber output_type;

struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& vals, coordinator_type coor, const output_type& o)
: values(vals)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-skip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ struct skip : public operator_base<T>

typedef Subscriber output_type;
struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& i, const output_type& oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-skip_last.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ struct skip_last : public operator_base<T>

typedef Subscriber output_type;
struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& i, const output_type& oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-skip_until.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ struct skip_until : public operator_base<T>

typedef Subscriber output_type;
struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& i, coordinator_type coor, const output_type& oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-subscribe_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ struct subscribe_on : public operator_base<T>

typedef Subscriber output_type;
struct subscribe_on_state_type
: public std::enable_shared_from_this<subscribe_on_state_type>
, public subscribe_on_values
: public subscribe_on_values
{
subscribe_on_state_type(const subscribe_on_values& i, const output_type& oarg)
: subscribe_on_values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-switch_on_next.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ struct switch_on_next
typedef Subscriber output_type;

struct switch_state_type
: public std::enable_shared_from_this<switch_state_type>
, public values
: public values
{
switch_state_type(values i, coordinator_type coor, output_type oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-take.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ struct take : public operator_base<T>

typedef Subscriber output_type;
struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& i, const output_type& oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-take_last.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ struct take_last : public operator_base<T>

typedef Subscriber output_type;
struct state_type
: public std::enable_shared_from_this<state_type>
, public values
: public values
{
state_type(const values& i, const output_type& oarg)
: values(i)
Expand Down
3 changes: 1 addition & 2 deletions Rx/v2/src/rxcpp/operators/rx-take_until.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ struct take_until : public operator_base<T>

typedef Subscriber output_type;
struct take_until_state_type
: public std::enable_shared_from_this<take_until_state_type>
, public values
: public values
{
take_until_state_type(const values& i, coordinator_type coor, const output_type& oarg)
: values(i)
Expand Down
7 changes: 2 additions & 5 deletions Rx/v2/src/rxcpp/operators/rx-with_latest_from.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ struct with_latest_from : public operator_base<rxu::value_type_t<with_latest_fro
value.reset(st);

if (state->valuesSet == sizeof... (ObservableN) && Index == 0) {
auto values = rxu::surely(state->latest);
auto selectedResult = rxu::apply(values, state->selector);
state->out.on_next(selectedResult);
state->out.on_next(rxu::apply(rxu::surely(state->latest), state->selector));
}
},
// on_error
Expand Down Expand Up @@ -204,8 +202,7 @@ struct with_latest_from : public operator_base<rxu::value_type_t<with_latest_fro
typedef Subscriber output_type;

struct with_latest_from_state_type
: public std::enable_shared_from_this<with_latest_from_state_type>
, public values
: public values
{
with_latest_from_state_type(values i, coordinator_type coor, output_type oarg)
: values(std::move(i))
Expand Down
7 changes: 3 additions & 4 deletions Rx/v2/src/rxcpp/operators/rx-zip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ struct zip : public operator_base<rxu::value_type_t<zip_traits<Coordination, Sel
auto& values = std::get<Index>(state->pending).values;
values.push_back(st);
if (rxu::apply_to_each(state->pending, values_not_empty(), rxu::all_values_true())) {
auto selectedResult = rxu::apply_to_each(state->pending, extract_value_front(), state->selector);
state->out.on_next(selectedResult);

state->out.on_next(rxu::apply_to_each(state->pending, extract_value_front(), state->selector));
}
if (rxu::apply_to_each(state->pending, source_completed_values_empty(), rxu::any_value_true())) {
state->out.on_completed();
Expand Down Expand Up @@ -236,8 +236,7 @@ struct zip : public operator_base<rxu::value_type_t<zip_traits<Coordination, Sel
typedef Subscriber output_type;

struct zip_state_type
: public std::enable_shared_from_this<zip_state_type>
, public values
: public values
{
zip_state_type(values i, coordinator_type coor, output_type oarg)
: values(std::move(i))
Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/rx-connectable_observable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class dynamic_connectable_observable
: public dynamic_observable<T>
{
struct state_type
: public std::enable_shared_from_this<state_type>
{
typedef std::function<void(composite_subscription)> onconnect_type;

Expand Down
8 changes: 6 additions & 2 deletions Rx/v2/src/rxcpp/rx-coroutine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ template<typename Source>
struct co_observable_iterator;

template<typename Source>
struct co_observable_iterator_state : std::enable_shared_from_this<co_observable_iterator_state<Source>>
struct co_observable_iterator_state
{
using value_type = typename Source::value_type;

Expand Down Expand Up @@ -69,9 +69,13 @@ struct co_observable_inc_awaiter
};

template<typename Source>
struct co_observable_iterator : public iterator<input_iterator_tag, typename Source::value_type>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::iterator is deprecated in C++17

struct co_observable_iterator
{
using iterator_category = input_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = typename Source::value_type;
using pointer = value_type*;
using reference = value_type&;

co_observable_iterator() {}

Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/rx-grouped_observable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class dynamic_grouped_observable

private:
struct state_type
: public std::enable_shared_from_this<state_type>
{
typedef std::function<key_type()> ongetkey_type;

Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/rx-notification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace detail {

template<typename T>
struct notification_base
: public std::enable_shared_from_this<notification_base<T>>
{
typedef subscriber<T> observer_type;
typedef std::shared_ptr<notification_base<T>> type;
Expand Down
1 change: 0 additions & 1 deletion Rx/v2/src/rxcpp/rx-observable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class dynamic_observable
: public rxs::source_base<T>
{
struct state_type
: public std::enable_shared_from_this<state_type>
{
typedef std::function<void(subscriber<T>)> onsubscribe_type;

Expand Down
2 changes: 1 addition & 1 deletion Rx/v2/src/rxcpp/rx-observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ namespace detail
{

template<class T>
struct virtual_observer : public std::enable_shared_from_this<virtual_observer<T>>
struct virtual_observer
{
virtual ~virtual_observer() {}
virtual void on_next(T&) const {};
Expand Down
3 changes: 0 additions & 3 deletions Rx/v2/src/rxcpp/rx-scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ struct worker_base : public subscription_base
};

class worker_interface
: public std::enable_shared_from_this<worker_interface>
{
typedef worker_interface this_type;

Expand Down Expand Up @@ -652,7 +651,6 @@ struct current_thread;
namespace detail {

class action_type
: public std::enable_shared_from_this<action_type>
{
typedef action_type this_type;

Expand Down Expand Up @@ -681,7 +679,6 @@ class action_type
};

class action_tailrecurser
: public std::enable_shared_from_this<action_type>
{
typedef action_type this_type;

Expand Down
4 changes: 2 additions & 2 deletions Rx/v2/src/rxcpp/rx-subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class static_subscription

class subscription : public subscription_base
{
class base_subscription_state : public std::enable_shared_from_this<base_subscription_state>
class base_subscription_state
{
base_subscription_state();
public:
Expand Down Expand Up @@ -243,7 +243,7 @@ class composite_subscription_inner
{
private:
typedef subscription::weak_state_type weak_subscription;
struct composite_subscription_state : public std::enable_shared_from_this<composite_subscription_state>
struct composite_subscription_state
{
// invariant: cannot access this data without the lock held.
std::set<subscription> subscriptions;
Expand Down
Loading