working with attributes
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Thu Jan 11 23:10:52 UTC 2024
On 12/01/2024 12:05 PM, Timon Gehr wrote:
> On 1/11/24 23:41, Walter Bright wrote:
>
> Any piece of code that accepts lambdas, callbacks, etc., should be
> very clear about attribute use and how that will apply to the
> lambdas, etc.
>
> The issue is, sometimes the piece of code that accepts lambdas is
> entirely unopinionated about what the right attributes are, but the
> callback and the calling code have a very strong opinion. There is no
> way to annotate this now that makes sense, you have to duplicate the
> code with different attribute annotations. I am not sure exactly how
> many overloads of |opApply| you need to cater to all use cases, but I
> think it is more than ten.
I have it implemented as a permutation...
This is awful for exports. It should be one, not 24 on top of a template
opApply that accepts anything internally.
https://github.com/Project-Sidero/basic_memory/blob/main/source/sidero/base/internal/meta.d#L4
More information about the Digitalmars-d
mailing list