algorithms/maxelement.bi

Summary
algorithms/maxelement.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
MaxElementFinds the first element in the range [//first//, //last//) with the maximum value.
MaxElementFinds the first element in the range [//first//, //last//) with the maximum value determined by a predicate //pred//.

License

Copyright © 2007-2011, FreeBASIC Extended Library Development Group

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

Functions

MaxElement

declare function MaxElement overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr
) as fbext_TypeName(T_) ptr

Finds the first element in the range [//first//, //last//) with the maximum value.

Parameters

firstA pointer to the first element in the range.
lastA pointer to one-past the last element in the range.

Returns

Returns a pointer to the element or //last// if the range is empty.

MaxElement

declare function MaxElement overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval pred as function ( byref as const fbext_TypeName(T_), byref as const fbext_TypeName(T_) ) as bool
) as fbext_TypeName(T_) ptr

Finds the first element in the range [//first//, //last//) with the maximum value determined by a predicate //pred//.

Parameters

firstA pointer to the first element in the range.
lastA pointer to one-past the last element in the range.

Returns

Returns a pointer to the element or //last// if the range is empty.

declare function MaxElement overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr
) as fbext_TypeName(T_) ptr
Finds the first element in the range [//first//, //last//) with the maximum value.