6#include <bond/core/config.h>
8#include "capped_allocator_fwd.h"
9#include "detail/counter_base.h"
11#include <boost/assert.hpp>
13namespace bond {
namespace ext
22 using is_thread_safe = std::false_type;
26 bool try_add(T n) BOND_NOEXCEPT
28 if (n <= this->max_value() && _value <= this->max_value() - n)
37 void subtract(T n) BOND_NOEXCEPT
39 BOOST_ASSERT(_value >= n);
43 T value()
const BOND_NOEXCEPT
Helper base class for counters.
Definition: counter_base.h:17
Single-threaded counter to be used with capped_allocator.
Definition: single_threaded_counter.h:20
namespace bond
Definition: apply.h:17