algorithms/adjacentfind.bi

Summary
algorithms/adjacentfind.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
AdjacentFindFinds the first of two consecutive elements in the range [first, last) that compare equal to each other using operator =.
AdjacentFindFinds the first of two consecutive elements in the range [first, last) that satisfy the 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

AdjacentFind

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

Finds the first of two consecutive elements in the range [first, last) that compare equal to each other using operator =.

Parameters

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

Returns

Returns a pointer to the element found, or last if there is no such element.

AdjacentFind

declare function AdjacentFind (
   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 ext.bool
) as fbext_TypeName(T_) ptr

Finds the first of two consecutive elements in the range [first, last) that satisfy the predicate pred.

Parameters

firstA pointer to the first element in the range to search.
lastA pointer one-past the element in the range to search.
predThe BinaryPredicate function to call.

Returns

Returns a pointer to the element found, or last if there is no such element.

declare function AdjacentFind overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr
) as fbext_TypeName(T_) ptr
Finds the first of two consecutive elements in the range [first, last) that compare equal to each other using operator =.