Browse Source

sys: alternative to bool(timer)

test/dev
Maxim Prokhorov 1 month ago
parent
commit
68f15a5728
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      code/espurna/system.h

+ 5
- 1
code/espurna/system.h View File

@ -235,10 +235,14 @@ struct SystemTimer {
SystemTimer(SystemTimer&&) = default;
SystemTimer& operator=(SystemTimer&&) = default;
explicit operator bool() const {
bool armed() const {
return _armed != nullptr;
}
explicit operator bool() const {
return armed();
}
void once(Duration duration, Callback callback) {
start(duration, std::move(callback), false);
}


Loading…
Cancel
Save