algorithms/equal.bi

Summary
algorithms/equal.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
EqualTests two ranges of elements [first, last) and beginning at first2 for equivalence.
EqualTests two ranges of elements [first, last) and beginning at first2 for equivalence using 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

Equal

declare function Equal overload (
   byval first1 as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval first2 as fbext_TypeName(T_) ptr
) as bool

Tests two ranges of elements [first, last) and beginning at first2 for equivalence.

Parameters

first1A pointer to the first element in the first range.
lastA pointer to one-past the end of the last element in the first range.
first2A pointer to the first element in the second range.

Returns

Returns true if all elements in each range compare equal, false otherwise.

Equal

declare function Equal (
   byval first1 as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval first2 as fbext_TypeName(T_) ptr,
   byval pred as function ( byref as const fbext_TypeName(T_), byref as const fbext_TypeName(T_) ) as bool
) as bool

Tests two ranges of elements [first, last) and beginning at first2 for equivalence using a predicate pred.

Parameters

first1A pointer to the first element in the first range.
lastA pointer to one-past the end of the last element in the first range.
first2A pointer to the first element in the second range.
predA binary predicate to compare elements.

Returns

Returns true if all corresponding elements in each range satisfy the predicate, false otherwise.

declare function Equal overload (
   byval first1 as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval first2 as fbext_TypeName(T_) ptr
) as bool
Tests two ranges of elements [first, last) and beginning at first2 for equivalence.