std:: indirect_result_t
| Iterator concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator primitives | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Algorithm concepts and utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
헤더 파일에 정의됨
<iterator>
|
||
|
template
<
class
F,
class
...
Is
>
requires
(
std::
indirectly_readable
<
Is
>
&&
...
)
&&
|
(C++20부터) | |
앨리어스 템플릿
indirect_result_t
는
invocable
타입
F
를
indirectly_readable
타입들
Is...
의 역참조 결과에 적용하여 호출한 결과 타입을 얻습니다.
템플릿 매개변수
| F | - | 호출 가능 타입 |
| Is | - | 인자로 역참조되는 간접 읽기 가능 타입들 |
예제
#include <iterator> #include <type_traits> struct Fn { long operator()(const int&); int operator()(int&&); short operator()(int, int) const; auto operator()(const float) -> int&; void operator()(int[8]); }; static_assert( std::is_same_v<std::indirect_result_t<Fn, const int*>, long> and std::is_same_v<std::indirect_result_t<Fn, std::move_iterator<int*>>, int> and std::is_same_v<std::indirect_result_t<const Fn, int*, int*>, short> and std::is_same_v<std::indirect_result_t<Fn, float*>, int&> and std::is_same_v<std::indirect_result_t<Fn, int**>, void> ); int main() {}
참고 항목
|
(C++11)
(removed in C++20)
(C++17)
|
호출 가능 객체를 인수 집합으로 호출한 결과 타입을 추론함
(클래스 템플릿) |
|
(C++26)
|
indirectly_readable
타입의 투영을 통해 값 타입을 계산함
(앨리어스 템플릿) |