reflect on this function
Vlad Levenfeld via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Feb 20 14:51:21 PST 2015
On Friday, 20 February 2015 at 22:44:35 UTC, ketmar wrote:
> can you go with `relationImpl` and mixin/template that generates
> `relation` with contract then? something like:
>
> @reflexive @transitive bool relationImpl (T)(T a, T b) { ... }
> alias relation = buildWithContracts!relationImpl;
>
> then you can simply call `relationImpl` in your out section.
Yeah, this looks pretty good. As much as I hate the pimpl idiom,
having a one-liner alias right next to the definition should
minimize the eye-bleeding. Thanks!
More information about the Digitalmars-d-learn
mailing list