mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +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:
@@ -38,7 +38,7 @@ Q_DECLARE_METATYPE(Ui::ShowWay);
|
||||
namespace App {
|
||||
namespace internal {
|
||||
|
||||
void CallDelayed(int duration, base::lambda<void()> &&lambda) {
|
||||
void CallDelayed(int duration, base::lambda_once<void()> &&lambda) {
|
||||
QTimer::singleShot(duration, base::lambda_slot_once(App::app(), std::move(lambda)), SLOT(action()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user