CXXIter 0.2
Loading...
Searching...
No Matches
CXXIter::SizeHint Struct Reference

Structure holding the bounds of a CXXIter iterator's estimated length. More...

#include <SizeHint.h>

Collaboration diagram for CXXIter::SizeHint:

Public Member Functions

constexpr size_t expectedResultSize (size_t min=0) const
 
constexpr SizeHint (size_t lowerBound=0, std::optional< size_t > upperBound={})
 
void subtract (size_t cnt)
 
void add (const SizeHint &o)
 

Static Public Member Functions

static constexpr std::optional< size_t > upperBoundMax (std::optional< size_t > upperBound1, std::optional< size_t > upperBound2)
 
static constexpr std::optional< size_t > upperBoundMin (std::optional< size_t > upperBound1, std::optional< size_t > upperBound2)
 

Public Attributes

size_t lowerBound
 
std::optional< size_t > upperBound
 

Static Public Attributes

static constexpr size_t INFINITE = std::numeric_limits<size_t>::max()
 

Detailed Description

Structure holding the bounds of a CXXIter iterator's estimated length.

This structure contains a lowerBound and an optional upper bound. Both are initialized from the source's length (if any), and subsequently edited by chained iteration accordingly.

Definition at line 15 of file SizeHint.h.

Constructor & Destructor Documentation

◆ SizeHint()

constexpr CXXIter::SizeHint::SizeHint ( size_t  lowerBound = 0,
std::optional< size_t >  upperBound = {} 
)
inlineconstexpr

Definition at line 23 of file SizeHint.h.

Member Function Documentation

◆ add()

void CXXIter::SizeHint::add ( const SizeHint o)
inline

Definition at line 40 of file SizeHint.h.

◆ expectedResultSize()

constexpr size_t CXXIter::SizeHint::expectedResultSize ( size_t  min = 0) const
inlineconstexpr

Definition at line 21 of file SizeHint.h.

◆ subtract()

void CXXIter::SizeHint::subtract ( size_t  cnt)
inline

Definition at line 34 of file SizeHint.h.

◆ upperBoundMax()

static constexpr std::optional< size_t > CXXIter::SizeHint::upperBoundMax ( std::optional< size_t >  upperBound1,
std::optional< size_t >  upperBound2 
)
inlinestaticconstexpr

Definition at line 25 of file SizeHint.h.

◆ upperBoundMin()

static constexpr std::optional< size_t > CXXIter::SizeHint::upperBoundMin ( std::optional< size_t >  upperBound1,
std::optional< size_t >  upperBound2 
)
inlinestaticconstexpr

Definition at line 29 of file SizeHint.h.

Member Data Documentation

◆ INFINITE

constexpr size_t CXXIter::SizeHint::INFINITE = std::numeric_limits<size_t>::max()
staticconstexpr

Definition at line 16 of file SizeHint.h.

◆ lowerBound

size_t CXXIter::SizeHint::lowerBound

Definition at line 18 of file SizeHint.h.

◆ upperBound

std::optional<size_t> CXXIter::SizeHint::upperBound

Definition at line 19 of file SizeHint.h.


The documentation for this struct was generated from the following file: