Mixin a function into a struct only if no member with that name already exists
tobias at pankrath.net
Wed Dec 29 10:14:13 UTC 2021
I am trying to implement the builder pattern for some structs.
Currently I am auto implementing all methods by mixing them into
the builder, but now I need some custom logic for some of the
fields and I figured I just write them down by hand and mixin the
I tried checking if it is contained in the FieldNameTuple, but
that (understandably) creates a circular reference:
How do I mixin a function only if it is not already present?
More information about the Digitalmars-d-learn