Re: Two way struct wrapper

2017-10-14 Thread drug via Digitalmars-d-learn
14.10.2017 16:23, Alex пишет: On Saturday, 14 October 2017 at 12:39:17 UTC, Alex wrote: ok, the last version for now. Without assumptions on alias number. Sorry for noise. https://run.dlang.io/is/OSJYtY That's cool, but unfortunately demands access to source code of Foo, it's not my case( I

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Saturday, 14 October 2017 at 12:39:17 UTC, Alex wrote: ok, the last version for now. Without assumptions on alias number. Sorry for noise. https://run.dlang.io/is/OSJYtY

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Saturday, 14 October 2017 at 11:25:20 UTC, Alex wrote: of course, with the proper operator in line 32 return T(mixin("this" ~ op ~ "f")); https://run.dlang.io/is/jGKVYN

Re: Two way struct wrapper

2017-10-14 Thread Alex via Digitalmars-d-learn
On Wednesday, 11 October 2017 at 12:35:51 UTC, drug wrote: Using `alias this` it's easy to make wrapper for structure that calls wrapped structure methods like its own. This is one way - from wrapper to wrapped transformation. Is it possible to create the opposite way from wrapped to wrapper?

Re: Two way struct wrapper

2017-10-13 Thread Igor via Digitalmars-d-learn
On Wednesday, 11 October 2017 at 12:35:51 UTC, drug wrote: Using `alias this` it's easy to make wrapper for structure that calls wrapped structure methods like its own. This is one way - from wrapper to wrapped transformation. Is it possible to create the opposite way from wrapped to wrapper?

Two way struct wrapper

2017-10-11 Thread drug via Digitalmars-d-learn
Using `alias this` it's easy to make wrapper for structure that calls wrapped structure methods like its own. This is one way - from wrapper to wrapped transformation. Is it possible to create the opposite way from wrapped to wrapper? https://run.dlang.io/is/Avyu3I All calls to Bar is