summaryrefslogtreecommitdiff
path: root/src/utils/cpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-03-09 18:11:20 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-03-09 18:11:20 +0100
commitf08ea2051eeff565d7d63d721371206133c48b63 (patch)
tree7e85a59a4fb6f2531192a42497fe89387233075a /src/utils/cpp
parentb44ba08941f87c3f03fefd54cab2d12012fa01ca (diff)
downloadjustbuild-f08ea2051eeff565d7d63d721371206133c48b63.tar.gz
FileSystemManager: Support set epoch time on file creation
Diffstat (limited to 'src/utils/cpp')
-rw-r--r--src/utils/cpp/concepts.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/cpp/concepts.hpp b/src/utils/cpp/concepts.hpp
index 92718b43..597179e1 100644
--- a/src/utils/cpp/concepts.hpp
+++ b/src/utils/cpp/concepts.hpp
@@ -1,6 +1,7 @@
#ifndef INCLUDED_SRC_UTILS_CPP_CONCEPTS_HPP
#define INCLUDED_SRC_UTILS_CPP_CONCEPTS_HPP
+#include <chrono>
#include <string>
#include <type_traits>
@@ -52,4 +53,17 @@ template <class T>
concept InputIterableStringContainer =
InputIterableContainer<T>and ContainsString<T>;
+// TODO(modernize): remove this once we require clang version >= 14.0.0
+template <typename T>
+concept ClockHasFromSys =
+ requires(std::chrono::time_point<std::chrono::system_clock> const tp) {
+ T::from_sys(tp);
+};
+
+// TODO(modernize): remove this once we require clang version >= 14.0.0
+template <typename T>
+concept ClockHasFromTime = requires(std::time_t const t) {
+ T::from_time_t(t);
+};
+
#endif // INCLUDED_SRC_UTILS_CPP_CONCEPTS_HPP