std::bad_expected_access
| 헤더 <expected>
|
||
template< class E >
class bad_expected_access : public std::bad_expected_access<void>
|
에 정의됨 (1) | (C++23부터) |
template<>
class bad_expected_access<void> : public std::exception
|
(2) | (C++23부터) |
bad_expected_access<E>은 예상치 못한 값의 복사본을 저장합니다.bad_expected_access<void>은 다른 모든 bad_expected_access 특수화의 기본 클래스입니다.| 이 섹션은 불완전합니다 이유: 상속 다이어그램 |
기본 템플릿의 멤버
|
(constructor)
|
bad_expected_access
객체를 생성합니다
(public member function) |
|
error
|
저장된 값을 반환합니다
(public member function) |
|
what
|
설명 문자열을 반환합니다
(public member function) |
std::bad_expected_access:: bad_expected_access
|
explicit
bad_expected_access
(
E e
)
;
|
(C++23부터)
(C++26부터 constexpr) |
|
새로운
bad_expected_access<E>
객체를 생성합니다. 저장된 값을
std::move(e)
로 초기화합니다.
std::bad_expected_access:: error
|
const
E
&
error
(
)
const
&
noexcept
;
|
(1) |
(C++23부터)
(C++26부터 constexpr) |
|
E
&
error
(
)
&
noexcept
;
|
(2) |
(C++23부터)
(C++26부터 constexpr) |
|
const
E
&&
error
(
)
const
&&
noexcept
;
|
(3) |
(C++23부터)
(C++26부터 constexpr) |
|
E
&&
error
(
)
&&
noexcept
;
|
(4) |
(C++23부터)
(C++26부터 constexpr) |
저장된 값에 대한 참조를 반환합니다.
std::bad_expected_access:: what
|
const
char
*
what
(
)
const
noexcept
override
;
|
(C++23부터)
(C++26부터 constexpr) |
|
설명 문자열을 반환합니다.
매개변수
(없음)
반환 값
설명 정보를 포함하는 null로 종료된 문자열에 대한 포인터. 이 문자열은 std::wstring 으로 변환 및 표시하기에 적합합니다. 이 포인터는 최소한 해당 포인터를 얻은 예외 객체가 소멸되거나, 예외 객체의 비상수 멤버 함수(예: 복사 할당 연산자)가 호출되기 전까지는 유효함이 보장됩니다.
|
상수 평가 중에는 반환된 문자열이 일반 리터럴 인코딩으로 인코딩됩니다. |
(C++26부터) |
참고
구현체는
what()
을 재정의할 수 있지만, 필수는 아닙니다.
bad_expected_access < void > 특수화의 멤버
|
(생성자)
|
bad_expected_access
<
void
>
객체를 생성함
(보호된 멤버 함수) |
|
(소멸자)
|
bad_expected_access
<
void
>
객체를 파괴함
(보호된 멤버 함수) |
|
operator=
|
bad_expected_access
<
void
>
객체를 대체함
(보호된 멤버 함수) |
|
what
|
설명 문자열을 반환함
(공개 멤버 함수) |
bad_expected_access < void > 의 특수 멤버 함수들은 보호되어 있습니다. 파생 클래스에서만 호출할 수 있습니다.
예제
|
이 섹션은 불완전합니다
이유: 예제가 없음 |