Skip to content

Instantly share code, notes, and snippets.

@vesim987
Created December 3, 2020 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesim987/e91f4945ab989b3aeeb32fd30e57eb04 to your computer and use it in GitHub Desktop.
Save vesim987/e91f4945ab989b3aeeb32fd30e57eb04 to your computer and use it in GitHub Desktop.
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