algorithms/replaceif.bi

Summary
algorithms/replaceif.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
ReplaceIfReplaces each element in the range [//first//, //last//) that satsifies a predicate //pred// with another value //newvalue//.

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

ReplaceIf

declare function ReplaceIf 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_) ) as bool,
   byref newvalue as const fbext_TypeName(T_)
) as fbext_TypeName(T_) ptr

Replaces each element in the range [//first//, //last//) that satsifies a predicate //pred// with another value //newvalue//.

Parameters

firstA pointer to the first element in the range.
lastA pointer to one-past the last element in the range.
predThe predicate to test the elements.
newvalueThe value to replace with.

Returns

Returns //last//.

declare function ReplaceIf 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_) ) as bool,
   byref newvalue as const fbext_TypeName(T_)
) as fbext_TypeName(T_) ptr
Replaces each element in the range [//first//, //last//) that satsifies a predicate //pred// with another value //newvalue//.