tfel
Loading...
Searching...
No Matches
tfel::fsalgo::min_element< N > Class Template Reference

min_element finds the smallest element in the range [first, first+N) More...

#include </home/runner/work/tfel/tfel/include/TFEL/FSAlgorithm/min_element.hxx>

Static Public Member Functions

template<typename ForwardIterator>
static TFEL_FSALGORITHM_INLINE ForwardIterator exe_ (ForwardIterator p, ForwardIterator q)
template<typename ForwardIterator, typename BinaryPredicate>
static TFEL_FSALGORITHM_INLINE ForwardIterator exe_ (ForwardIterator p, ForwardIterator q, BinaryPredicate comp)
template<typename ForwardIterator>
static TFEL_FSALGORITHM_INLINE ForwardIterator exe (ForwardIterator p)
template<typename ForwardIterator, typename BinaryPredicate>
static TFEL_FSALGORITHM_INLINE ForwardIterator exe (ForwardIterator p, BinaryPredicate comp)

Detailed Description

template<unsigned int N>
class tfel::fsalgo::min_element< N >

min_element finds the smallest element in the range [first, first+N)

Template Parameters
Nnumber of elements of the range.

This documentation is mostly inspired from: http://www.sgi.com/tech/stl/min_element.html

Author
Thomas Helfer
Date
30/06/2006

Member Function Documentation

◆ exe() [1/2]

template<unsigned int N>
template<typename ForwardIterator>
TFEL_FSALGORITHM_INLINE ForwardIterator tfel::fsalgo::min_element< N >::exe ( ForwardIterator p)
inlinestatic

It returns the first iterator i in [first, first+N) such that no other iterator in [first, last) points to a value smaller than *i. The return value is first+N if and only if [first, last) is an empty range.

Template Parameters
ForwardIteratoriterator to the elements.
Parameters
[in]piterator to the first element
Returns
ForwardIterator to the minimum element
Precondition
  • ForwardIterator is a model of Forward Iterator.
  • ForwardIterator's value type is LessThan Comparable.
Author
Thomas Helfer
Date
30/06/2006

◆ exe() [2/2]

template<unsigned int N>
template<typename ForwardIterator, typename BinaryPredicate>
TFEL_FSALGORITHM_INLINE ForwardIterator tfel::fsalgo::min_element< N >::exe ( ForwardIterator p,
BinaryPredicate comp )
inlinestatic

This version version returns the first iterator i in [first, first+N) such that, for every iterator j in [first, first+N), comp(*i, *j) is false, where comp is a binary predicate given in argument

Template Parameters
ForwardIteratoriterator to the elements.
BinaryPredicatecomparison function
Parameters
[in]piterator to the first element
[in]compcomparison function
Returns
ForwardIterator to the minimum element
Precondition
  • ForwardIterator is a model of Forward Iterator.
  • BinaryPredicate is a model of Binary Predicate.
  • ForwardIterator's value type is convertible to BinaryPredicate's first argument type and second argument type.
Author
Thomas Helfer
Date
30/06/2006

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