mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use std::function for base::lambda implementation.
base::lambda becomes just std::function and base::lambda_once becomes base::unique_function - a move-only wrapper around std::function. This is required because Visual C++ 2017 15.4.1 has a compiler bug with static member variables of class templates, they may collide. The std::function uses inheritance and virtual functions instead of custom vtables done by static members of class templates used in custom base::lambda implementation, so they work fine.
This commit is contained in:
@@ -208,7 +208,11 @@ namespace {
|
||||
|
||||
void logOut() {
|
||||
if (auto mtproto = Messenger::Instance().mtp()) {
|
||||
mtproto->logout(rpcDone(&loggedOut), rpcFail(&loggedOut));
|
||||
mtproto->logout(rpcDone([] {
|
||||
return loggedOut();
|
||||
}), rpcFail([] {
|
||||
return loggedOut();
|
||||
}));
|
||||
} else {
|
||||
// We log out because we've forgotten passcode.
|
||||
// So we just start mtproto from scratch.
|
||||
|
Reference in New Issue
Block a user