std::indirect<T, Allocator>:: indirect
|
constexpr
explicit
indirect
(
)
;
|
(1) | (C++26부터) |
|
constexpr
explicit
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a
)
;
|
(2) | (C++26부터) |
|
template
<
class
U
=
T
>
constexpr explicit indirect ( U && v ) ; |
(3) | (C++26부터) |
|
template
<
class
U
=
T
>
constexpr
explicit
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(4) | (C++26부터) |
|
template
<
class
...
Args
>
constexpr explicit indirect ( std:: in_place_t , Args && ... args ) ; |
(5) | (C++26 이후) |
|
template
<
class
...
Args
>
constexpr
explicit
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(6) | (C++26부터) |
|
template
<
class
I,
class
...
Args
>
constexpr
explicit
indirect
(
std::
in_place_t
,
std::
initializer_list
<
I
>
ilist,
|
(7) | (C++26부터) |
|
template
<
class
I,
class
...
Args
>
constexpr
explicit
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(8) | (C++26부터) |
|
constexpr
indirect
(
const
indirect
&
other
)
;
|
(9) | (C++26부터) |
|
constexpr
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a,
const indirect & other ) ; |
(10) | (C++26부터) |
|
constexpr
indirect
(
indirect
&&
other
)
noexcept
;
|
(11) | (C++26부터) |
|
constexpr
indirect
(
std::
allocator_arg_t
,
const
Allocator
&
a,
indirect && other ) noexcept ( /* 아래 참조 */ ) ; |
(12) | (C++26부터) |
새로운
indirect
객체를 생성합니다.
목차 |
매개변수
| a | - | 연결될 할당자 |
| v | - | 소유한 값을 초기화할 값 |
| args | - | 소유한 값을 초기화할 인수들 |
| il | - | 소유한 값을 초기화할 초기화자 리스트 |
| other | - |
소유한 값(존재하는 경우)이 복사될 다른
indirect
객체
|
효과
새로운
indirect
객체의 생성은 다음 단계들로 구성됩니다:
alloc
를 생성합니다:
-
alloc에 대한 초기화자가 비어 있는 경우, 값 초기화 됩니다. -
alloc에 대한 초기화자가 비어 있지 않은 경우, 초기화자 인수로 직접 비목록 초기화 됩니다.
-
오버로드
(
1-8
)
의 경우,
p를 std:: allocator_traits < Allocator > :: allocate 호출 결과로 초기화한 다음, std:: allocator_traits < Allocator > :: construct (alloc ,p , args... ) 를 호출합니다. 여기서 args... 는 초기화 인수를 포함하는 표현식 팩입니다. - 오버로드 ( 9-12 ) 의 경우:
| 오버로드 | 초기화 대상... |
valueless_after_move()
생성 후 |
|
|---|---|---|---|
alloc
|
소유된 객체 | ||
| ( 1 ) | (비어 있음) | (비어 있음) | false |
| ( 2 ) | a | ||
| ( 3 ) | (비어 있음) | std:: forward < U > ( v ) | |
| ( 4 ) | a | ||
| ( 5 ) | (비어 있음) | std:: forward < Args > ( args ) | |
| ( 6 ) | a | ||
| ( 7 ) | (비어 있음) | ilist, std:: forward < Args > ( args ) | |
| ( 8 ) | a | ||
| ( 9 ) | 아래 참조 |
*
other
(only if other owns a value) |
true only if other is valueless |
| ( 10 ) | a | ||
| ( 11 ) |
std
::
move
(
other.
alloc
)
|
소유권 이전
(only if other owns a value) |
|
| ( 12 ) | a | 아래 참조 | |
alloc
는
std::
allocator_traits
<
Allocator
>
::
select_on_container_copy_construction
(
other.
alloc
)
로 직접-비목록-초기화됩니다.
제약 조건 및 보충 정보
U
Args...
- std:: is_same_v < std:: remove_cvref_t < U > , std :: indirect >
- std:: is_same_v < std:: remove_cvref_t < U > , std:: in_place_t >
T
가
불완전 타입
인 경우, 프로그램은 형식이 잘못되었습니다.
예외
std:: allocator_traits < Allocator > :: allocate 또는 std:: allocator_traits < Allocator > :: construct 가 예외를 던지지 않는 한 아무것도 던지지 않습니다.
예제
|
이 섹션은 불완전합니다
이유: 예제가 없음 |
참고 항목
|
(C++11)
|
할당자 인식 생성자 오버로드를 선택하는 데 사용되는 태그 타입
(클래스) |
|
인플레이스 생성 태그
(태그) |