std::ranges::hive_limits
From cppreference.com
| Defined in header <hive>
|
||
struct hive_limits;
|
(since C++26) | |
std::hive_limits is a class that holds a layout information about std::hive's block capacity limits.
Data members
| Object | Description |
min |
a value of type std::size_t that represents minimum block capacity limit (public member object) |
max |
a value of type std::size_t that represents maximum block capacity limit (public member object) |
Member functions
std::hive_limits::hive_limits
constexpr hive_limits( std::size_t minimum, std::size_t maximum ) noexcept
|
(since C++26) | |
Constructs the hive limits and copy-initializes the data members min and max with provided arguments minimum and maximum accordingly.
Parameters
| minimum | - | a value to assign to this->min
|
| maximum | - | a value to assign to this->max
|
Standard library
The following standard library class template uses std::hive_limits:
(C++26) |
collection that reuses erased elements' memory (class template) |
Synopsis
namespace std
{
struct hive_limits
{
size_t min;
size_t max;
constexpr hive_limits(size_t minimum, size_t maximum) noexcept
: min(minimum)
, max(maximum)
{}
};
}
Example
Run this code
#include <hive>
#include <iostream>
int main()
{
std::hive h{1, 2, 3};
std::hive_limits l = h.block_capacity_default_limits();
std::cout << l.min << ' ' << l.max << '\n';
}
Possible output:
76 255
See also
| implements binary tuple, i.e. a pair of values (class template) |