aboutsummaryrefslogtreecommitdiff
path: root/src/meta.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/meta.zig')
-rw-r--r--src/meta.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/meta.zig b/src/meta.zig
new file mode 100644
index 000000000..afc502d58
--- /dev/null
+++ b/src/meta.zig
@@ -0,0 +1,12 @@
+const std = @import("std");
+
+pub usingnamespace std.meta;
+
+pub fn ReturnOf(comptime function: anytype) type {
+ return ReturnOfType(@TypeOf(function));
+}
+
+pub fn ReturnOfType(comptime Type: type) type {
+ const typeinfo: std.builtin.TypeInfo.Fn = @typeInfo(Type);
+ return typeinfo.return_type orelse void;
+}