8#ifndef INCLUDED_BSLSTL_CHRONO
9#define INCLUDED_BSLSTL_CHRONO
129#include <bslscm_version.h>
138#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
142#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
149using std::chrono::duration;
150using std::chrono::time_point;
151using std::chrono::system_clock;
152using std::chrono::steady_clock;
153using std::chrono::high_resolution_clock;
154using std::chrono::treat_as_floating_point;
155using std::chrono::duration_values;
156using std::chrono::duration_cast;
157using std::chrono::time_point_cast;
158using std::chrono::hours;
159using std::chrono::minutes;
160using std::chrono::seconds;
161using std::chrono::milliseconds;
162using std::chrono::microseconds;
163using std::chrono::nanoseconds;
165#ifdef BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
169constexpr bool treat_as_floating_point_v =
170 std::chrono::treat_as_floating_point<TYPE>::value;
173#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
174using std::chrono::abs;
175using std::chrono::ceil;
176using std::chrono::floor;
177using std::chrono::round;
180#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR
181using std::chrono::days;
182using std::chrono::weeks;
183using std::chrono::months;
184using std::chrono::years;
186using std::chrono::is_clock;
187using std::chrono::is_clock_v;
189 using std::chrono::sys_time;
190 using std::chrono::sys_seconds;
191 using std::chrono::sys_days;
192using std::chrono::file_clock;
193 using std::chrono::file_time;
194using std::chrono::local_t;
195 using std::chrono::local_time;
196 using std::chrono::local_seconds;
197 using std::chrono::local_days;
199using std::chrono::clock_time_conversion;
200using std::chrono::clock_cast;
202using std::chrono::last_spec;
203using std::chrono::last;
204using std::chrono::day;
205using std::chrono::month;
206 using std::chrono::January;
207 using std::chrono::February;
208 using std::chrono::March;
209 using std::chrono::April;
210 using std::chrono::May;
211 using std::chrono::June;
212 using std::chrono::July;
213 using std::chrono::August;
214 using std::chrono::September;
215 using std::chrono::October;
216 using std::chrono::November;
217 using std::chrono::December;
218using std::chrono::year;
219using std::chrono::weekday;
220 using std::chrono::Sunday;
221 using std::chrono::Monday;
222 using std::chrono::Tuesday;
223 using std::chrono::Wednesday;
224 using std::chrono::Thursday;
225 using std::chrono::Friday;
226 using std::chrono::Saturday;
227using std::chrono::weekday_indexed;
228using std::chrono::weekday_last;
230using std::chrono::month_day;
231using std::chrono::month_day_last;
232using std::chrono::month_weekday;
233using std::chrono::month_weekday_last;
234using std::chrono::year_month;
235using std::chrono::year_month_day;
236using std::chrono::year_month_day_last;
237using std::chrono::year_month_weekday;
238using std::chrono::year_month_weekday_last;
240using std::chrono::hh_mm_ss;
242using std::chrono::is_am;
243using std::chrono::is_pm;
244using std::chrono::make12;
245using std::chrono::make24;
247#ifndef BSLS_PLATFORM_OS_WINDOWS
249using std::chrono::utc_clock;
250 using std::chrono::utc_time;
251 using std::chrono::utc_seconds;
252using std::chrono::tai_clock;
253 using std::chrono::tai_time;
254 using std::chrono::tai_seconds;
255using std::chrono::gps_clock;
256 using std::chrono::gps_time;
257 using std::chrono::gps_seconds;
260using std::chrono::from_stream;
261using std::chrono::parse;
264#ifndef BSLS_PLATFORM_OS_WINDOWS
266#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE
267using std::chrono::tzdb;
268using std::chrono::tzdb_list;
269using std::chrono::sys_info;
270using std::chrono::local_info;
271using std::chrono::get_tzdb_list;
272using std::chrono::get_tzdb;
273using std::chrono::remote_version;
274using std::chrono::reload_tzdb;
276using std::chrono::time_zone;
277using std::chrono::choose;
278using std::chrono::zoned_traits;
279using std::chrono::zoned_time;
280using std::chrono::zoned_seconds;
281using std::chrono::time_zone_link;
283using std::chrono::nonexistent_local_time;
284using std::chrono::ambiguous_local_time;
286using std::chrono::leap_second;
287using std::chrono::leap_second_info;
288using std::chrono::get_leap_second_info;
293#ifdef BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
294inline namespace literals {
295inline namespace chrono_literals {
297using namespace std::literals::chrono_literals;
303#if defined (BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY) && \
304 defined (BSLS_COMPILERFEATURES_SUPPORT_INLINE_NAMESPACE)
306inline namespace literals {
307inline namespace chrono_literals {
313bsl::chrono::hours
operator""_h(
unsigned long long hrs);
315bsl::chrono::duration<long double, bsl::ratio<3600, 1>>
operator""_h(
322bsl::chrono::minutes
operator""_min(
unsigned long long mins);
324bsl::chrono::duration<long double, bsl::ratio<60, 1>>
operator""_min(
331bsl::chrono::seconds
operator""_s(
unsigned long long secs);
333bsl::chrono::duration<long double>
operator""_s(
long double secs);
339bsl::chrono::milliseconds
operator""_ms(
unsigned long long ms);
341bsl::chrono::duration<long double, bsl::milli>
operator""_ms(
long double ms);
347bsl::chrono::microseconds
operator""_us(
unsigned long long us);
349bsl::chrono::duration<long double, bsl::micro>
operator""_us(
long double us);
355bsl::chrono::nanoseconds
operator""_ns(
unsigned long long ns);
357bsl::chrono::duration<long double, bsl::nano>
operator""_ns(
long double ns);
367#if defined (BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY) && \
368 defined (BSLS_COMPILERFEATURES_SUPPORT_INLINE_NAMESPACE)
370inline namespace literals {
371inline namespace chrono_literals {
374bsl::chrono::hours
operator""_h(
unsigned long long hrs)
376 return bsl::chrono::hours(hrs);
380bsl::chrono::duration<long double, bsl::ratio<3600, 1>>
operator""_h(
383 return bsl::chrono::duration<long double, bsl::ratio<3600, 1>>(hrs);
387bsl::chrono::minutes
operator""_min(
unsigned long long mins)
389 return bsl::chrono::minutes(mins);
393bsl::chrono::duration<long double, bsl::ratio<60, 1>>
394 operator""_min(
long double mins)
396 return bsl::chrono::duration<long double, bsl::ratio<60, 1>>(mins);
400bsl::chrono::seconds
operator""_s(
unsigned long long secs)
402 return bsl::chrono::seconds(secs);
406bsl::chrono::duration<long double>
operator""_s(
long double secs)
408 return bsl::chrono::duration<long double>(secs);
412bsl::chrono::milliseconds
operator""_ms(
unsigned long long ms)
414 return bsl::chrono::milliseconds(ms);
418bsl::chrono::duration<long double, bsl::milli>
operator""_ms(
long double ms)
420 return bsl::chrono::duration<long double, bsl::milli>(ms);
424bsl::chrono::microseconds
operator""_us(
unsigned long long us)
426 return bsl::chrono::microseconds(us);
430bsl::chrono::duration<long double, bsl::micro>
operator""_us(
long double us)
432 return bsl::chrono::duration<long double, bsl::micro>(us);
436bsl::chrono::nanoseconds
operator""_ns(
unsigned long long ns)
438 return bsl::chrono::nanoseconds(ns);
442bsl::chrono::duration<long double, bsl::nano>
operator""_ns(
long double ns)
444 return bsl::chrono::duration<long double, bsl::nano>(ns);
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:624
Definition bdlat_valuetypefunctions.h:939