diff --git a/td/telegram/net/ConnectionCreator.h b/td/telegram/net/ConnectionCreator.h index 92c7a5eee..49091245b 100644 --- a/td/telegram/net/ConnectionCreator.h +++ b/td/telegram/net/ConnectionCreator.h @@ -172,9 +172,8 @@ class ConnectionCreator final : public NetQueryCallback { std::shared_ptr media_net_stats_callback_; std::shared_ptr common_net_stats_callback_; - ActorShared<> ref_cnt_guard_; + ActorShared ref_cnt_guard_; int ref_cnt_{0}; - ActorShared create_reference(int64 token); bool close_flag_{false}; uint64 current_token_ = 0; std::map>> children_; @@ -190,6 +189,8 @@ class ConnectionCreator final : public NetQueryCallback { return ++current_token_; } + ActorShared create_reference(int64 token); + void set_active_proxy_id(int32 proxy_id, bool from_binlog = false); void enable_proxy_impl(int32 proxy_id); void disable_proxy_impl(); diff --git a/tdactor/td/actor/impl/ActorId-decl.h b/tdactor/td/actor/impl/ActorId-decl.h index 9fc7f6b98..220abcdb3 100644 --- a/tdactor/td/actor/impl/ActorId-decl.h +++ b/tdactor/td/actor/impl/ActorId-decl.h @@ -123,8 +123,6 @@ class ActorShared { ActorId get() const; ActorId release(); void reset(ActorId other = ActorId()); - template - void reset(ActorId other); private: ActorId id_; diff --git a/tdactor/td/actor/impl/ActorId.h b/tdactor/td/actor/impl/ActorId.h index 30cbbfb91..389833e19 100644 --- a/tdactor/td/actor/impl/ActorId.h +++ b/tdactor/td/actor/impl/ActorId.h @@ -160,17 +160,11 @@ ActorId ActorShared::release() { template void ActorShared::reset(ActorId other) { - reset(std::move(other)); -} - -template -template -void ActorShared::reset(ActorId other) { static_assert(sizeof(ActorType) > 0, "Can't use ActorShared with incomplete type"); if (!id_.empty()) { send_event(*this, Event::hangup()); } - id_ = static_cast>(other); + id_ = std::move(other); } template