algorithms/ minelement.bi

Summary
algorithms/ minelement.bi
LicenseCopyright © 2009, FreeBASIC Extended Library Development Group
Functions
MinElementReturns a pointer to the element in a range with the minimum value.
MinElementReturns a pointer to the element in a range using a predicate.

License

Copyright © 2009, 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

MinElement

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

Returns a pointer to the element in a range with the minimum value.

Parameters

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

Returns

Returns a pointer to the element in the range with the minimum value, or last if the range is empty.

MinElement

declare function MinElement 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

Returns a pointer to the element in a range using a predicate.

Parameters

firstA pointer to the first element in the range.
lastA pointer to one-past the element in the range.
predA function to compare elements with.

Returns

Returns a pointer to the element in the range which satisfies the predicate against all other elements, or last if the range is empty.

declare function MinElement overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr
) as fbext_TypeName(T_) ptr
Returns a pointer to the element in a range with the minimum value.