BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::default_searcher< ForwardIterator1, BinaryPredicate > Class Template Reference

#include <bslstl_defaultsearcher.h>

Public Member Functions

BSLS_KEYWORD_CONSTEXPR default_searcher (ForwardIterator1 pat_first, ForwardIterator1 pat_last, BinaryPredicate pred=BinaryPredicate())
 
 default_searcher (const default_searcher &original)=default
 
 default_searcher (BloombergLP::bslmf::MovableRef< default_searcher > original)=default
 
 ~default_searcher ()=default
 Destroy this default_searcher object.
 
default_searcheroperator= (const default_searcher &rhs)=default
 
default_searcheroperator= (BloombergLP::bslmf::MovableRef< default_searcher > rhs)=default
 
template<class ForwardIterator2 >
BSLS_KEYWORD_CONSTEXPR pair< ForwardIterator2, ForwardIterator2 > operator() (ForwardIterator2 first, ForwardIterator2 last) const
 

Constructor & Destructor Documentation

◆ default_searcher() [1/3]

template<class ForwardIterator1 , class BinaryPredicate >
BSLS_KEYWORD_CONSTEXPR bsl::default_searcher< ForwardIterator1, BinaryPredicate >::default_searcher ( ForwardIterator1  pat_first,
ForwardIterator1  pat_last,
BinaryPredicate  pred = BinaryPredicate() 
)
inline

Create a default_searcher object that can search for the sequence of value_type values found in the specified range [pat_first, pat_last). Optionally supply a pred functor for use by operator(). See {Comparator Requirements}. The behavior is undefined unless pat_first can be advanced to equal pat_last .

◆ default_searcher() [2/3]

template<class ForwardIterator1 , class BinaryPredicate = equal_to< typename bsl::iterator_traits<ForwardIterator1>::value_type>>
bsl::default_searcher< ForwardIterator1, BinaryPredicate >::default_searcher ( const default_searcher< ForwardIterator1, BinaryPredicate > &  original)
default

Create a default_searcher object having same state as the specified original object.

◆ default_searcher() [3/3]

template<class ForwardIterator1 , class BinaryPredicate = equal_to< typename bsl::iterator_traits<ForwardIterator1>::value_type>>
bsl::default_searcher< ForwardIterator1, BinaryPredicate >::default_searcher ( BloombergLP::bslmf::MovableRef< default_searcher< ForwardIterator1, BinaryPredicate > >  original)
default

Create a default_searcher object having same state as the specified original object. by moving (in constant time) the state of original to the new searcher. The original object is left in an unspecified (valid) state.

◆ ~default_searcher()

template<class ForwardIterator1 , class BinaryPredicate = equal_to< typename bsl::iterator_traits<ForwardIterator1>::value_type>>
bsl::default_searcher< ForwardIterator1, BinaryPredicate >::~default_searcher ( )
default

Member Function Documentation

◆ operator()()

template<class ForwardIterator1 , class BinaryPredicate >
template<class ForwardIterator2 >
BSLS_KEYWORD_CONSTEXPR pair< ForwardIterator2, ForwardIterator2 > bsl::default_searcher< ForwardIterator1, BinaryPredicate >::operator() ( ForwardIterator2  first,
ForwardIterator2  last 
) const
inline

Search the specified range [first, last) for the first sequence of value_type values specified on construction. Return the range where those values are found, or the range [last, last) if that sequence is not found. The search is performed using a "naive" algorithm that has time complexity of:

bsl::distance(pat_first, pat_last) * bsl::distance(first, last);

Values of the two sequences are compared using the equality comparison functor specified on construction. The behavior is undefined unless first can be advanced to equal last and the iterators used to construct this object are still valid. Note that if the sought sequence is empty, the range [first, first) is returned. Also note that if the sequence sought is longer than the sequence searched – thus the sought sequence cannot be found – the range [last, last) is returned.

◆ operator=() [1/2]

template<class ForwardIterator1 , class BinaryPredicate = equal_to< typename bsl::iterator_traits<ForwardIterator1>::value_type>>
default_searcher & bsl::default_searcher< ForwardIterator1, BinaryPredicate >::operator= ( BloombergLP::bslmf::MovableRef< default_searcher< ForwardIterator1, BinaryPredicate > >  rhs)
default

Assign to this object the state of the specified rhs object and return a non-const reference to this searcher.

◆ operator=() [2/2]

template<class ForwardIterator1 , class BinaryPredicate = equal_to< typename bsl::iterator_traits<ForwardIterator1>::value_type>>
default_searcher & bsl::default_searcher< ForwardIterator1, BinaryPredicate >::operator= ( const default_searcher< ForwardIterator1, BinaryPredicate > &  rhs)
default

Assign to this object the state of the specified rhs object, and return a non-const reference to this searcher.


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