algorithms/replacecopy.bi

Summary
algorithms/replacecopy.bi
LicenseCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Functions
ReplaceCopyReplaces each element in the range [//first//, //last//) that has a certain value //oldvalue// with another value //newvalue// and copies the results to the range beginning at //result//.

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

ReplaceCopy

declare function ReplaceCopy overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval result as fbext_TypeName(T_) ptr,
   byref oldvalue as const fbext_TypeName(T_),
   byref newvalue as const fbext_TypeName(T_)
) as fbext_TypeName(T_) ptr

Replaces each element in the range [//first//, //last//) that has a certain value //oldvalue// with another value //newvalue// and copies the results to the range beginning at //result//.

Parameters

firstA pointer to the first element in the range.
lastA pointer to one-past the last element in the range.
resultA pointer to the first element in the range that will hold the results.
oldvalueThe value to be replaced.
newvalueThe value to replace with.

Returns

Returns the last element copied.

declare function ReplaceCopy overload (
   byval first as fbext_TypeName(T_) ptr,
   byval last as fbext_TypeName(T_) ptr,
   byval result as fbext_TypeName(T_) ptr,
   byref oldvalue as const fbext_TypeName(T_),
   byref newvalue as const fbext_TypeName(T_)
) as fbext_TypeName(T_) ptr
Replaces each element in the range [//first//, //last//) that has a certain value //oldvalue// with another value //newvalue// and copies the results to the range beginning at //result//.