HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
policy.hpp
1
2
3#pragma once
4
5#include "enum_metadata.hpp"
6#include "../macros.hpp"
7#include <format>
8
9hi_export_module(hikogui.utility.policy);
10
11hi_export namespace hi { inline namespace v1 {
12
18enum class policy { unspecified, low_power, high_performance };
19
20// clang-format off
21constexpr auto policy_metadata = enum_metadata{
22 policy::unspecified, "unspecified",
23 policy::low_power, "low-power",
24 policy::high_performance, "high-performance"
25};
26// clang-format on
27
28}} // namespace hi::v1
29
30// XXX #617 MSVC bug does not handle partial specialization in modules.
31hi_export template<>
32struct std::formatter<hi::policy, char> : std::formatter<std::string_view, char> {
33 auto format(hi::policy const& t, auto& fc) const
34 {
35 return std::formatter<std::string_view, char>::format(hi::policy_metadata[t], fc);
36 }
37};
The HikoGUI namespace.
Definition array_generic.hpp:20
policy
The performance policy to use.
Definition policy.hpp:18
DOXYGEN BUG.
Definition algorithm_misc.hpp:20