E.V.E
v2023.02.15
Loading...
Searching...
No Matches

Detailed Description

Integral type an algorithm counts indices in.

Variables

template<std::unsigned_integral T>
constexpr auto eve::algo::index_type = (index_type_key = std::type_identity<T>{})

Variable Documentation

◆ index_type

template<std::unsigned_integral T>
auto eve::algo::index_type = (index_type_key = std::type_identity<T>{})
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
template<std::unsigned_integral T> inline constexpr auto index_type = eve_implementation_defined;
}
constexpr auto index_type
Definition traits.hpp:787
Template Parameters
TUnsigned integral type holding an index.

Sets the unsigned integral type indices are counted in. By default the type is the smallest one that covers the widest element the algorithm reads, and is never narrower than std::uint16_t, so that the index of a range of bytes is not reset every 255 elements.

std::vector<std::int8_t> samples(100'000);
// The index runs in 32 bits: the loop flushes it every four billion elements instead of
// every 65535, in exchange for wider index registers.
auto lowest = min_element[index_type<std::uint32_t>](samples);
constexpr auto min_element
SIMD version of std::min_element.
Definition min_element.hpp:256
See also
Algorithm Traits