mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Made base::lambda a copyable value type.
Now base::lambda can be copied and can wrap any immutable lambda. For mutable lambdas there is base::lambda_once (which you're supposed to call only once to pass data through lambda captures, for example by using std::unique_ptr). Generally base::lambda is passed by value and base::lambda_once is passed by rvalue reference.
This commit is contained in:
@@ -722,11 +722,11 @@ void Widget::Step::showAnimated(Direction direction) {
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::Step::setGoCallback(base::lambda<void(Step *step, Direction direction)> &&callback) {
|
||||
void Widget::Step::setGoCallback(base::lambda<void(Step *step, Direction direction)> callback) {
|
||||
_goCallback = std::move(callback);
|
||||
}
|
||||
|
||||
void Widget::Step::setShowResetCallback(base::lambda<void()> &&callback) {
|
||||
void Widget::Step::setShowResetCallback(base::lambda<void()> callback) {
|
||||
_showResetCallback = std::move(callback);
|
||||
}
|
||||
|
||||
|
@@ -100,8 +100,8 @@ public:
|
||||
setFocus();
|
||||
}
|
||||
|
||||
void setGoCallback(base::lambda<void(Step *step, Direction direction)> &&callback);
|
||||
void setShowResetCallback(base::lambda<void()> &&callback);
|
||||
void setGoCallback(base::lambda<void(Step *step, Direction direction)> callback);
|
||||
void setShowResetCallback(base::lambda<void()> callback);
|
||||
|
||||
void prepareShowAnimated(Step *after);
|
||||
void showAnimated(Direction direction);
|
||||
|
Reference in New Issue
Block a user