Bond
 
Loading...
Searching...
No Matches
bond::ext::shared_counter< Counter > Class Template Reference

Shared counter to be used with capped_allocator. More...

Public Member Functions

 shared_counter (value_type max_value)
 Constructs counter using default "operator new". More...
 
template<typename Alloc >
 shared_counter (value_type max_value, const Alloc &alloc)
 Allocates counter using the provided allocator. More...
 

Detailed Description

template<typename Counter>
class bond::ext::shared_counter< Counter >

Shared counter to be used with capped_allocator.

Template Parameters
Counterunderlying counter type.

Constructor & Destructor Documentation

◆ shared_counter() [1/2]

template<typename Counter >
bond::ext::shared_counter< Counter >::shared_counter ( value_type  max_value)
explicit

Constructs counter using default "operator new".

◆ shared_counter() [2/2]

template<typename Counter >
template<typename Alloc >
bond::ext::shared_counter< Counter >::shared_counter ( value_type  max_value,
const Alloc &  alloc 
)

Allocates counter using the provided allocator.

Remarks
The provided limit is applied to counter allocation as well.