HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
time_zone.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
10#pragma once
11
12#include "../macros.hpp"
13#include "debugger.hpp"
14#include "exception.hpp"
15#include <chrono>
16
17hi_export_module(hikogui.utility.time_zone);
18
19hi_export namespace hi { inline namespace v1 {
20namespace detail {
21
22[[nodiscard]] inline std::chrono::time_zone const *_cached_current_zone() noexcept
23{
24 try {
25 return std::chrono::current_zone();
26 } catch (...) {
27 hi_debug_abort("std::chrono::current_zone() throws");
28 }
29}
30
31} // namespace detail
32
39[[nodiscard]] inline std::chrono::time_zone const& cached_current_zone() noexcept
40{
41 static auto *zone = detail::_cached_current_zone();
42 return *zone;
43}
44
45}} // namespace hi::v1
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
std::chrono::time_zone const & cached_current_zone() noexcept
Cached current time zone.
Definition time_zone.hpp:39