mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +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:
@@ -37,10 +37,10 @@ public:
|
||||
SendFilesBox(QWidget*, const QStringList &files, CompressConfirm compressed);
|
||||
SendFilesBox(QWidget*, const QString &phone, const QString &firstname, const QString &lastname);
|
||||
|
||||
void setConfirmedCallback(base::lambda<void(const QStringList &files, bool compressed, const QString &caption, bool ctrlShiftEnter)> &&callback) {
|
||||
void setConfirmedCallback(base::lambda<void(const QStringList &files, bool compressed, const QString &caption, bool ctrlShiftEnter)> callback) {
|
||||
_confirmedCallback = std::move(callback);
|
||||
}
|
||||
void setCancelledCallback(base::lambda<void()> &&callback) {
|
||||
void setCancelledCallback(base::lambda<void()> callback) {
|
||||
_cancelledCallback = std::move(callback);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user