std::chrono:: clock_time_conversion
|
헤더 파일에 정의됨
<chrono>
|
||
|
template
<
class
Dest,
class
Source
>
struct clock_time_conversion { } ; |
(C++20부터) | |
std::chrono::clock_time_conversion
는
std::chrono::time_point
의
Source
클록을
Dest
클록으로 변환하는 방법을 지정하는 특성(trait)입니다. 이는
std::
chrono
::
time_point
<
Source, Duration
>
타입의 인수를 받아들이고 동일한 시간점을 나타내는
std::
chrono
::
time_point
<
Dest, OtherDuration
>
를 반환하는 const-callable
operator()
를 제공함으로써 이를 수행합니다. 반환된 시간점의 지속 시간(duration)은 각 특수화에 따라 다양한 방식으로 소스 지속 시간에서 계산됩니다.
clock_time_conversion
는 일반적으로
std::chrono::clock_cast
를 통해서만 간접적으로 사용됩니다.
프로그램은 템플릿 매개변수 중 적어도 하나가 사용자 정의 클록 타입인 경우
clock_time_conversion
를 특수화할 수 있습니다.
기본 템플릿은 빈 구조체입니다. 표준은 다음과 같은 특수화를 정의합니다:
|
template
<
class
Clock
>
struct clock_time_conversion < Clock, Clock > ; |
(1) | (C++20부터) |
|
template
<>
struct clock_time_conversion < std:: chrono :: system_clock , std:: chrono :: system_clock > ; |
(2) | (C++20부터) |
|
template
<>
struct clock_time_conversion < std:: chrono :: utc_clock , std:: chrono :: utc_clock > ; |
(3) | (C++20부터) |
|
template
<>
struct clock_time_conversion < std:: chrono :: system_clock , std:: chrono :: utc_clock > ; |
(4) | (C++20부터) |
|
template
<>
struct clock_time_conversion < std:: chrono :: utc_clock , std:: chrono :: system_clock > ; |
(5) | (C++20부터) |
|
template
<
class
Clock
>
struct clock_time_conversion < Clock, std:: chrono :: system_clock > ; |
(6) | (C++20부터) |
|
template
<
class
Clock
>
struct clock_time_conversion < std:: chrono :: system_clock , Clock > ; |
(7) | (C++20부터) |
|
template
<
class
Clock
>
struct clock_time_conversion < Clock, std:: chrono :: utc_clock > ; |
(8) | (C++20부터) |
|
template
<
class
Clock
>
struct clock_time_conversion < std:: chrono :: utc_clock , Clock > ; |
(9) | (C++20부터) |
operator()
는 인수의 복사본을 반환합니다.
operator()
는 각각
std::chrono::utc_clock::to_sys
와
std::chrono::utc_clock::from_sys
를 호출합니다.
Clock
이
from_sys
와
to_sys
를 지원할 때
std::chrono::sys_time
과의 상호 변환:
operator()
는 각각
Clock
::
to_sys
와
Clock
::
from_sys
를 호출합니다.
Clock
이
from_utc
와
to_utc
를 지원할 때
std::chrono::utc_time
와의 상호 변환:
operator()
는 각각
Clock
::
to_utc
와
Clock
::
from_utc
를 호출합니다.
목차 |
멤버 함수
각 특수화는 암시적으로 선언된 기본 생성자, 복사 생성자, 이동 생성자, 복사 할당 연산자, 이동 할당 연산자 및 소멸자를 가집니다.
std::chrono::clock_time_conversion:: operator()
|
template
<
class
Duration
>
std::
chrono
::
time_point
<
Clock, Duration
>
|
(1) | (전문화 멤버 (1) ) |
|
template
<
class
Duration
>
std::
chrono
::
sys_time
<
Duration
>
|
(2) | (전문화 멤버 (2) ) |
|
template
<
class
Duration
>
std::
chrono
::
utc_time
<
Duration
>
|
(3) | (전문화 멤버 (3) ) |
|
template
<
class
Duration
>
std::
chrono
::
sys_time
<
Duration
>
|
(4) | (전문화 멤버 (4) ) |
|
template
<
class
Duration
>
std::
chrono
::
utc_time
<
Duration
>
|
(5) | (전문화 멤버 (5) ) |
|
template
<
class
Duration
>
auto
operator
(
)
(
const
std::
chrono
::
sys_time
<
Duration
>
&
t
)
const
|
(6) | (전문화 멤버 (6) ) |
|
template
<
class
Duration
>
auto
operator
(
)
(
const
std::
chrono
::
time_point
<
SourceClock, Duration
>
&
t
)
const
|
(7) | (전문화 멤버 (7) ) |
|
template
<
class
Duration
>
auto
operator
(
)
(
const
std::
chrono
::
utc_time
<
Duration
>
&
t
)
const
|
(8) | (전문화 멤버 (8) ) |
|
template
<
class
Duration
>
auto
operator
(
)
(
const
std::
chrono
::
time_point
<
Clock, Duration
>
&
t
)
const
|
(9) | (전문화 멤버 (9) ) |
인수를 대상 클록으로 변환합니다. std::chrono::time_point
t
를 변경 없이 반환합니다.
Duration
은
std::chrono::duration
의 유효한 특수화입니다.
Duration
은
std::chrono::duration
의 유효한 특수화입니다.
Duration
은
std::chrono::duration
의 유효한 특수화 중 하나여야 합니다.
Duration
은
std::chrono::duration
의 유효한 특수화입니다.
매개변수
| t | - | 변환할 시간 지점 |
반환값
위에서 설명한 변환의 결과:
참고 항목
|
(C++20)
|
한 클록의 시간 포인트를 다른 클록으로 변환
(함수 템플릿) |