Spec-Zone.ru › C++

std::ranges::hive_limits

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:

hive
(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

#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

pair
implements binary tuple, i.e. a pair of values
(class template)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/container/hive/hive_limits

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API