15 std::function<void()> notify;
20 friend class NotifyingCounter;
26 void operator()(NotifyingCounter * c)
const
33 std::unique_ptr<NotifyingCounter<T>, SubOnFree> at;
35 Bump(NotifyingCounter<T> & at, T delta) : at(&at, {delta}) {}
39 Bump(
decltype(
nullptr)) {}
43 return at ? at.get_deleter().delta : 0;
52 explicit NotifyingCounter(std::function<
void()> notify, T initial = 0)
54 , notify(std::move(notify))
81 NotifyingCounter & operator+=(T delta)
87 NotifyingCounter & operator++(
int)
92 Bump addTemporarily(T delta)
95 return Bump{*
this, delta};