5 ms·
I think this could be basically done as a check in the stdlib relatively easily, via something like: const MyConcept = std.concept.build(.{...}); cons
by throwawaymaths 4y ago
I think this could be basically done as a check in the stdlib relatively easily, via something like:
const MyConcept = std.concept.build(.{...});
const requires = std.concept.requires;
const MyType =
requires(
MyConcept,
struct{
...
});
requires simply passes through the type passed to it.
If it fails, it gives some nicely formatted compile time errors.