std::experimental::simd_mask<T,Abi>:: operator[]
From cppreference.net
<
cpp
|
experimental
|
simd
|
simd mask
C++
Experimental
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
Extensions for parallelism v2
| Parallel exceptions | ||||
| Additional execution policies | ||||
| Algorithms | ||||
| Task blocks | ||||
| Data-parallel vectors | ||||
SIMD library
std::experimental::simd_mask
| Member functions | ||||||||||||
|
||||||||||||
| Non-member functions | ||||||||||||
|
reference operator
[
]
(
size_t i
)
;
|
(1) | (parallelism TS v2) |
|
bool
operator
[
]
(
size_t i
)
const
;
|
(2) | (parallelism TS v2) |
첨자 연산자는
simd_mask
의 개별 요소를 읽고 쓸 수 있도록 합니다.
1)
i번째 요소에 대한 참조 프록시를 반환합니다. 이 프록시 타입은 lvalue로 캡처되어서는 안 됩니다.
simd_mask::reference
의 lvalue는
value_type
으로만 변환될 수 있습니다.
simd_mask::reference
의 rvalue는 할당 및 모든 복합 할당 연산자와
swap
을 오버로드합니다.
2)
i번째 요소의 prvalue를 반환합니다.
value_type
타입의 객체를 포함하는 컨테이너들과 달리,
simd_mask
는 개별 객체들의 컨테이너가 아니므로 lvalue-reference를 반환할 수 없습니다.
매개변수
| i | - |
요소 인덱스.
size()
미만이어야 함
|
예제
이 코드 실행
#include <cstddef> #include <experimental/simd> #include <iostream> namespace stdx = std::experimental; int main() { stdx::native_simd_mask<int> a{true}; a[1] = 0; for (std::size_t i = 0; i != a.size(); ++i) std::cout << a[i] << ' '; std::cout << '\n'; }
가능한 출력:
1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1