For a specified example, how will the method hasAtomicDecl
be implemented?
const std = @import("std");
const T = union(enum) {
x: struct {
const isAtomic = void;
},
y: struct {
},
fn hasAtomicDecl(self: T) bool {
...
}
};
const fields = std.meta.fields(A);
pub fn main() !void {
var a: T = .{.x = .{}};
var b: T = .{.y = .{}};
std.debug.print("{}, {}\n", .{a.hasAtomicDecl(), b.hasAtomicDecl()});
}