Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Transforms » RemoveNils

RemoveNils


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 all Nil elements from an array.

Applications: This filter is useful e.g. when inspecting multiple objects while some of the inspections may fail (Nil result). RemoveNils is used to ignore the failed cases in the final result.

Syntax

void avl::RemoveNils
(
	const atl::Array< typename atl::ToConditionalType<Type>::Type >& inArray,
	atl::Array<Type>& outArray,
	atl::Optional<atl::Array<bool>&> outElementExisted = atl::NIL
)

Parameters

Name Type Default Description
Input value inArray const Array< typename ToConditionalType<Type>::Type >& Input array
Output value outArray Array<Type>& Output array
Output value outElementExisted Optional<Array<bool>&> NIL Array with the same size as input array representing if the element was not a Nil

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outElementExisted.

Read more about Optional Outputs.

Examples

inArray = {2, 5, Nil, Nil, 7, Nil}
outArray = {2, 5, 7}