diff --git a/tdactor/td/actor/PromiseFuture.h b/tdactor/td/actor/PromiseFuture.h index 23aff5f61..a4439f2d1 100644 --- a/tdactor/td/actor/PromiseFuture.h +++ b/tdactor/td/actor/PromiseFuture.h @@ -135,7 +135,7 @@ class LambdaPromise : public PromiseInterface { , on_fail_(use_ok_as_fail ? OnFail::Ok : OnFail::Fail) , has_lambda_(true) { } - template + template , LambdaPromise>::value, int> = 0> LambdaPromise(FromOkT &&ok) : LambdaPromise(std::forward(ok), Ignore(), true) { } @@ -307,7 +307,7 @@ class Promise { } Promise(SafePromise &&other); Promise &operator=(SafePromise &&other); - template + template , Promise>::value, int> = 0> Promise(F &&f) : promise_(promise_interface_ptr(std::forward(f))) { } diff --git a/tdactor/td/actor/impl/Event.h b/tdactor/td/actor/impl/Event.h index c61598c58..bd4c421fe 100644 --- a/tdactor/td/actor/impl/Event.h +++ b/tdactor/td/actor/impl/Event.h @@ -97,7 +97,7 @@ class LambdaEvent final : public CustomEvent { LOG(FATAL) << "Not supported"; return nullptr; } - template + template , LambdaEvent>::value, int> = 0> explicit LambdaEvent(FromLambdaT &&lambda) : f_(std::forward(lambda)) { } diff --git a/tdutils/td/utils/optional.h b/tdutils/td/utils/optional.h index c54ea2b57..0004ec201 100644 --- a/tdutils/td/utils/optional.h +++ b/tdutils/td/utils/optional.h @@ -31,6 +31,9 @@ class optional { } optional &operator=(const optional &other) { + if (this == &other) { + return *this; + } if (other) { impl_ = Result(other.value()); } else {