Algo::RemoveIf

Moves all elements which do not match the predicate to the front of the range, while leaving all other elements is a constructed but unspecified state.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Algo/RemoveIf.h

Include

#include "Algo/RemoveIf.h"

Syntax

namespace Algo
{
    template<typename RangeType, typename Predicate>
    int32 Algo::RemoveIf
    (
        RangeType & Range,
        Predicate Pred
    )
}

Remarks

Moves all elements which do not match the predicate to the front of the range, while leaving all other elements is a constructed but unspecified state. The elements which were not removed are not guaranteed to be kept in order (unstable).

Returns

The index of the first element after those which were not removed.

Parameters

Parameter

Description

Range

The range of elements to manipulate.

Pred

A callable which maps elements to truthy values, specifying elements to be removed.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss