2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +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:
John Preston
2017-02-26 14:32:13 +03:00
parent f82989c9c3
commit c207743338
78 changed files with 662 additions and 633 deletions

View File

@@ -528,7 +528,7 @@ bool ContactsBox::creationFail(const RPCError &error) {
ContactsBox::Inner::ContactData::ContactData() = default;
ContactsBox::Inner::ContactData::ContactData(PeerData *peer, const base::lambda_copy<void()> &updateCallback)
ContactsBox::Inner::ContactData::ContactData(PeerData *peer, base::lambda<void()> updateCallback)
: checkbox(std::make_unique<Ui::RoundImageCheckbox>(st::contactsPhotoCheckbox, updateCallback, PaintUserpicCallback(peer))) {
}
@@ -1471,7 +1471,7 @@ void ContactsBox::Inner::peerUnselected(PeerData *peer) {
changePeerCheckState(data, peer, false, ChangeStateWay::SkipCallback);
}
void ContactsBox::Inner::setPeerSelectedChangedCallback(base::lambda<void(PeerData *peer, bool selected)> &&callback) {
void ContactsBox::Inner::setPeerSelectedChangedCallback(base::lambda<void(PeerData *peer, bool selected)> callback) {
_peerSelectedChangedCallback = std::move(callback);
}