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
30template<typename CharT>
31struct std::formatter<hi::policy, CharT> : std::formatter<std::string_view, CharT> {
32 auto format(hi::policy const& t, auto& fc) const
33 {
34 return std::formatter<std::string_view, CharT>::format(hi::policy_metadata[t], fc);
35 }
36};
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
policy
The performance policy to use.
Definition policy.hpp:18