Back to FabImage 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: fil
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 fil::RemoveNils
(
	const ftl::Array< typename ftl::ToConditionalType<Type>::Type >& inArray,
	ftl::Array<Type>& outArray,
	ftl::Optional<ftl::Array<bool>&> outElementExisted = ftl::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 ftl::NIL to these parameters: outElementExisted.

Read more about Optional Outputs.

Examples

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