CoreComponents 3.0.0
A Modern C++ Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Modules
FindFirst Class Reference

Find first item which equals pattern. More...

#include <cc/find>

Static Public Member Functions

template<class Order = DefaultOrder, class Container , class Pattern = typename Container::Item, class Index = long>
static bool find (const Container *items, const Pattern &pattern, Index *finalIndex)
 Search in a sorted list of items.
 
template<class Order = DefaultOrder, class Container , class Pattern = typename Container::Item, class Index = long>
static bool find (Container *items, const Pattern &pattern, Index *finalIndex=nullptr, typename Container::Item **finalItem=nullptr)
 

Detailed Description

Find first item which equals pattern.

Member Function Documentation

◆ find()

template<class Order = DefaultOrder, class Container , class Pattern = typename Container::Item, class Index = long>
static bool find ( const Container * items,
const Pattern & pattern,
Index * finalIndex )
static

Search in a sorted list of items.

Template Parameters
OrderSorting order
ContainerArray type
PatternPattern type
IndexIndex type
Parameters
itemsThe sorted list of items
patternPattern to search for
finalIndexReturns the final index of the search
Returns
True if a matching item was found, false otherwise