Returns the index of the first set element in a SIMD comparison register.

Synopsis

Declared in <folly/algorithm/simd/FindFixed.h>

template<
    typename Scalar,
    typename Reg>
std::optional<std::size_t>
firstTrue(Reg reg);

Return Value

Index of the first matching element, or std::nullopt if none.

Parameters

Name

Description

reg

The SIMD comparison‐result register.

Created with MrDocs