BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl::IteratorUtil Struct Reference

#include <bslstl_iteratorutil.h>

Detailed Description

This utility struct provides a namespace for functions on iterators and iterator ranges.

See bslstl_iteratorutil

Static Public Member Functions

template<class t_INPUT_ITERATOR , class t_SENTINEL >
static BSLS_KEYWORD_CONSTEXPR bool canCalculateInsertDistance ()
 
template<class t_INPUT_ITERATOR , class t_SENTINEL >
static bsl::iterator_traits< t_INPUT_ITERATOR >::difference_type insertDistance (const t_INPUT_ITERATOR &first, const t_SENTINEL &last)
 

Member Function Documentation

◆ canCalculateInsertDistance()

template<class t_INPUT_ITERATOR , class t_SENTINEL >
BSLS_KEYWORD_CONSTEXPR bool bslstl::IteratorUtil::canCalculateInsertDistance ( )
static

Return true if the calculation of insertDistance is supported for iterators of the specified types, false otherwise.

◆ insertDistance()

template<class t_INPUT_ITERATOR , class t_SENTINEL >
bsl::iterator_traits< t_INPUT_ITERATOR >::difference_type bslstl::IteratorUtil::insertDistance ( const t_INPUT_ITERATOR &  first,
const t_SENTINEL &  last 
)
static

Return 0 if the (template parameter) type t_INPUT_ITERATOR is limited to the standard input-iterator category, otherwise return the number of elements reachable from the specified first to (but not including) the specified last. This function has a constant-time complexity if the iterator category of t_INPUT_ITERATOR is strictly a standard input iterator, or is a random access iterator, otherwise it is linear in the length of the range [first .. last).

Precondition
The behavior is undefined unless last is reachable from first.

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