This commit is contained in:
2025-03-21 13:08:23 +03:00
parent c0cba8422f
commit 441743ff01
5 changed files with 114 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <chrono>
#include <format>
#include <ranges>
@@ -38,6 +39,15 @@ concept mcc_formattable =
requires(T v, std::format_context ctx) { std::formatter<std::remove_cvref_t<T>>().format(v, ctx); };
template <typename T>
// from https://stackoverflow.com/questions/74383254/concept-that-models-only-the-stdchrono-duration-types
concept mcc_time_duration_c = requires {
[]<class Rep, class Period>(std::type_identity<std::chrono::duration<Rep, Period>>) {
}(std::type_identity<std::remove_cvref_t<T>>());
};
/* a callable concept and its signature traits */
template <typename T>