Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Composition » RemoveValueFromArray

RemoveValueFromArray


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: STD.h
Namespace: avl
Module: FoundationLite

Removes the first or all of the elements of the given value from an array.

Syntax

void avl::RemoveValueFromArray
(
	atl::Array<Type>& ioArray,
	const Type& inValue,
	bool inRemoveAll
)

Parameters

Name Type Default Description
Input will be modified ioArray Array<Type>&
Input value inValue const Type& Input value to be removed
Input value inRemoveAll bool Remove all occurrences, not only the first one

Description

The operation removes the first or all of the inArray elements equal to inValue, depending on the inRemoveAll parameter.

Examples

inArray = {1,2,2,0,2}
inValue = 2
inRemoveAll = False
outArray = {1,2,0,2}
inArray = {1,2,2,0,2}
inValue = 2
inRemoveAll = True
outArray = {1,0}

Remarks

Please note, that this filter can be concretized only with basic data types and structures of such types. Concretizing the filter with a non-comparable complex data type, such as Image or Region, will raise a Domain Error.

Using this filter to compare data of type Real (or structures with this type) may be tricky. It is caused by the fact that very small (unnoticeable) differences in values of such types may lead to unpredictable negative results in comparison of these values.

Errors

Non-comparable complex data type "TypeName" used in RemoveValueFromArray.

See Also