Blender V4.5
blender::binary_search Namespace Reference

Namespaces

namespace  tests

Functions

template<typename Iterator, typename Predicate>
static int64_t first_if (Iterator begin, Iterator end, Predicate &&predicate)
template<typename Iterator, typename Predicate>
static int64_t last_if (Iterator begin, Iterator end, Predicate &&predicate)
template<typename Range, typename Predicate>
int64_t first_if (const Range &range, Predicate &&predicate)
template<typename Range, typename Predicate>
int64_t last_if (const Range &range, Predicate &&predicate)

Function Documentation

◆ first_if() [1/2]

◆ first_if() [2/2]

template<typename Iterator, typename Predicate>
int64_t blender::binary_search::first_if ( Iterator begin,
Iterator end,
Predicate && predicate )
static

Find the index of the first element where the predicate is true. The predicate must also be true for all following elements. If the predicate is false for all elements, the size of the range is returned.

Definition at line 21 of file BLI_binary_search.hh.

References begin(), and first_if().

Referenced by first_if(), and first_if().

◆ last_if() [1/2]

template<typename Range, typename Predicate>
int64_t blender::binary_search::last_if ( const Range & range,
Predicate && predicate )

◆ last_if() [2/2]

template<typename Iterator, typename Predicate>
int64_t blender::binary_search::last_if ( Iterator begin,
Iterator end,
Predicate && predicate )
static

Find the index of the last element where the predicate is true. The predicate must also be true for all previous elements. If the predicate is false for all elements, the -1 is returned.

Definition at line 35 of file BLI_binary_search.hh.

References begin(), and last_if().

Referenced by last_if(), and last_if().