aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/executor.ccm
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.posix/executor.ccm')
-rw-r--r--nihil.posix/executor.ccm27
1 files changed, 27 insertions, 0 deletions
diff --git a/nihil.posix/executor.ccm b/nihil.posix/executor.ccm
new file mode 100644
index 0000000..f348dc8
--- /dev/null
+++ b/nihil.posix/executor.ccm
@@ -0,0 +1,27 @@
+/*
+ * This source code is released into the public domain.
+ */
+
+module;
+
+#include <concepts>
+#include <type_traits>
+
+export module nihil.posix:executor;
+
+namespace nihil {
+
+/*
+ * A concept to mark spawn executors.
+ */
+
+export struct exec_tag{};
+
+export template<typename T>
+concept executor =
+ requires (T e) {
+ std::same_as<exec_tag, typename std::remove_cvref_t<T>::tag>;
+ { e.exec() };
+ };
+
+} // namespace nihil