A container with fixed capacity featuring constant time insertion and removal at opposite ends; i.e., with an interface similar to std::queue. The storage for the elements is held directly within the class. Storing more than Capacity elements results in overwriting the oldest element.
More...
|
| constexpr | circular_buffer () noexcept |
| | Construct an empty queue.
|
| |
| template<typename Iterator, constraints< std::enable_if_t< arene::base::is_forward_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< value_type, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr> |
| constexpr | circular_buffer (Iterator in_begin, Iterator in_end) noexcept(noexcept(::arene::base::distance(in_begin, in_end)) &&std::is_nothrow_constructible< value_type, typename std::iterator_traits< Iterator >::reference >::value) |
| | Construct a queue from a range of elements, taken to be in front -> back order.
|
| |
| template<typename U = value_type, constraints< std::enable_if_t< std::is_copy_constructible< U >::value > > = nullptr> |
| constexpr | circular_buffer (std::initializer_list< value_type > init) noexcept(noexcept(circular_buffer(init.begin(), init.end()))) |
| | Construct a queue by copying from an initializer list of elements, taken to be in front -> back order.
|
| |
template<typename T,
std::size_t Capacity>
class arene::base::circular_buffer< T, Capacity >
A container with fixed capacity featuring constant time insertion and removal at opposite ends; i.e., with an interface similar to std::queue. The storage for the elements is held directly within the class. Storing more than Capacity elements results in overwriting the oldest element.
- Template Parameters
-
| T | The type of each element |
| Capacity | The maximum number of elements that can be stored |