Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
C++26: Vector subscripting

Access individual elements or select elements using an index vector. More...

Functions

constexpr value_type xvec::simd::basic_vec< _Tp, _Abi >::operator[] (simd_size_type pos) const
 Access the element at the specified position.
constexpr auto xvec::simd::basic_vec< _Tp, _Abi >::operator[] (const vec_integral auto &indexes) const
 Select vector elements using an integral index vector.

Detailed Description

Access individual elements or select elements using an index vector.

See also
https://eel.is/c++draft/simd.subscr

Function Documentation

◆ operator[]() [1/2]

template<typename _Tp, typename _Abi>
auto xvec::simd::basic_vec< _Tp, _Abi >::operator[] ( const vec_integral auto & indexes) const
inlineconstexpr

Select vector elements using an integral index vector.

Parameters
indexesThe indexes by which to permute.
Returns
The selected elements, with the same element count as indexes.

◆ operator[]() [2/2]

template<typename _Tp, typename _Abi>
value_type xvec::simd::basic_vec< _Tp, _Abi >::operator[] ( simd_size_type pos) const
inlineconstexpr

Access the element at the specified position.

Parameters
posThe element index, which must be less than size() and non-negative.