1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-23 14:25:11 +00:00

Increases const correctness, marks some additional constructors as constexpr, switches std::atomic construction style.

This commit is contained in:
Thomas Harte
2020-05-20 23:34:26 -04:00
parent 41fc6c20a0
commit 512a52e88d
59 changed files with 136 additions and 140 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ template <typename TimeUnit> class DeferredQueue {
@returns The amount of time until the next enqueued action will occur,
or TimeUnit(-1) if the queue is empty.
*/
TimeUnit time_until_next_action() {
TimeUnit time_until_next_action() const {
if(pending_actions_.empty()) return TimeUnit(-1);
return pending_actions_.front().delay;
}
@@ -95,7 +95,7 @@ template <typename TimeUnit> class DeferredQueue {
template <typename TimeUnit> class DeferredQueuePerformer: public DeferredQueue<TimeUnit> {
public:
/// Constructs a DeferredQueue that will call target(period) in between deferred actions.
DeferredQueuePerformer(std::function<void(TimeUnit)> &&target) : target_(std::move(target)) {}
constexpr DeferredQueuePerformer(std::function<void(TimeUnit)> &&target) : target_(std::move(target)) {}
/*!
Runs for @c length units of time.