std::chrono:: nonexistent_local_time
|
헤더에 정의됨
<chrono>
|
||
|
class
nonexistent_local_time
;
|
(C++20부터) | |
존재하지 않는
std::chrono::local_time
을
std::chrono::choose
(예:
choose::earliest
나
choose::latest
)를 지정하지 않고
std::chrono::sys_time
으로 변환하려는 시도를 보고하기 위해 예외로 던져지는 객체 유형을 정의합니다.
이 예외는 std::chrono::time_zone::to_sys 와 이를 호출하는 함수들(예: std::chrono::zoned_time 의 생성자 중 std::chrono::local_time 를 취하는 경우)에 의해 발생합니다.
상속 다이어그램
목차 |
멤버 함수
|
(constructor)
|
예외 객체를 생성합니다
(public member function) |
|
operator=
|
예외 객체를 대체합니다
(public member function) |
|
what
|
설명 문자열을 반환합니다
(public member function) |
std::chrono::nonexistent_local_time:: nonexistent_local_time
|
template
<
class
Duration
>
nonexistent_local_time
(
const
std::
chrono
::
local_time
<
Duration
>
&
tp,
|
(1) | (since C++20) |
|
nonexistent_local_time
(
const
nonexistent_local_time
&
other
)
noexcept
;
|
(2) | (since C++20) |
예외 객체를 생성합니다.
what()
이 반환하는 설명 문자열은 다음 코드 실행 후
os.str()
이 생성하는 문자열과 동일합니다:
std::ostringstream os; os << tp << " is in a gap between\n" << std::chrono::local_seconds(i.first.end.time_since_epoch()) + i.first.offset << ' ' << i.first.abbrev << " and\n" << std::chrono::local_seconds(i.second.begin.time_since_epoch()) + i.second.offset << ' ' << i.second.abbrev << " which are both equivalent to\n" << i.first.end << " UTC";
std::chrono::nonexistent_local_time
동적 타입을 가진다면
std::
strcmp
(
what
(
)
, other.
what
(
)
)
==
0
입니다.
매개변수
| tp | - | 변환이 시도된 시간 지점 |
| i | - | 변환 시도 결과를 설명하는 std::chrono::local_info |
| other | - |
복사할 다른
nonexistent_local_time
객체
|
예외
std::bad_alloc 을 던질 수 있습니다.
참고
std::exception
에서 파생된 표준 라이브러리 클래스를 복사하는 것은 예외를 던지는 것이 허용되지 않기 때문에, 이 메시지는 일반적으로 별도로 할당된 참조 카운트 문자열로 내부에 저장됩니다.
std::chrono::nonexistent_locale_time:: operator=
|
nonexistent_locale_time
&
operator
=
(
const
nonexistent_locale_time
&
other
)
noexcept
;
|
(C++20부터) | |
other
의 내용을 할당합니다.
*
this
와
other
모두 동적 타입이
std::chrono::nonexistent_locale_time
인 경우, 할당 후
std::
strcmp
(
what
(
)
, other.
what
(
)
)
==
0
입니다.
매개변수
| other | - | 할당할 다른 예외 객체 |
반환 값
* this
std::chrono::nonexistent_locale_time:: what
|
virtual
const
char
*
what
(
)
const
noexcept
;
|
(C++20부터) | |
설명 문자열을 반환합니다.
반환 값
설명 정보를 담은 구현 정의 널 종료 문자열에 대한 포인터. 이 문자열은 std::wstring 으로 변환 및 표시하기에 적합합니다. 이 포인터는 최소한 해당 예외 객체가 소멸되거나, 예외 객체의 비상수 멤버 함수(예: 복사 할당 연산자)가 호출되기 전까지는 유효함이 보장됩니다.
참고
구현체는
what()
을 재정의할 수 있지만 필수는 아닙니다.
std:: runtime_error 에서 상속됨
std:: exception 에서 상속됨
멤버 함수
|
[virtual]
|
예외 객체를 파괴함
(
std::exception
의 virtual public member function)
|
|
[virtual]
|
설명 문자열을 반환함
(
std::exception
의 virtual public member function)
|
참고 항목
|
(C++20)
|
지역 시간이 모호함을 보고하기 위해 던져지는 예외
(클래스) |