Created
December 3, 2020 20:57
-
-
Save vesim987/e91f4945ab989b3aeeb32fd30e57eb04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn QObject(comptime T: type) type { | |
const typeInfo: std.builtin.TypeInfo = @typeInfo(T); | |
const str: std.builtin.TypeInfo.Struct = typeInfo.Struct; | |
return struct { | |
const parentType = T; | |
const Self = @This(); | |
const name: []const u8 = @typeName(T); | |
pub fn create() type { | |
for (str.fields) |field| { | |
std.debug.print("name: {}\n", .{field.name}); | |
} | |
return Self{}; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment