algorithms/countif.bi

Summary
algorithms/countif.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
CountIfFinds the number of elements in the range [first, last) that satisfy 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

CountIf

declare function CountIf overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval pred as fbext_Predicate(T_)
) as ext.SizeType

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

Parameters

firstA pointer to the first element in the range to search.
lastA pointer to one-past the last element in the range to search.
predA predicate to test the elements with.

Returns

Returns the number of found elements, or zero (0) if no such elements are found.

declare function CountIf overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval pred as fbext_Predicate(T_)
) as ext.SizeType
Finds the number of elements in the range [first, last) that satisfy a predicate pred.