Eliminating code duplication for static/nonstatic functions
safety0ff
safety0ff.dev at gmail.com
Thu Sep 19 21:59:15 PDT 2013
On Thursday, 19 September 2013 at 17:20:53 UTC, Andrej Mitrovic
wrote:
> On Thursday, 19 September 2013 at 17:10:43 UTC, Andrei
> Alexandrescu wrote:
>> Any ideas for a clean solution? I can't get much further than
>> string mixins, which wouldn't be clean :o).
>
> opDispatch comes to mind. You'd only need two of them, one
> marked static and the other one not.
Hello,
I decided to try and solve this as an exercise with the
opDispatch hint above.
I am not very experienced with D, but I am sharing my solution
anyway in case it is of interest: http://dpaste.dzfl.pl/3bde7db1
Enjoy/Destroy :)
More information about the Digitalmars-d
mailing list