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 redirected to Foo, but output of Foo is not
redirected to Bar.

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 redirected to Foo, but output of Foo is not
redirected to Bar.

I don't see how compiler can just deduce that... In either case
you can just wrap the expression with another Bar():
auto v5 = Bar(Bar(Foo(2)) + Bar(Foo(3)));

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 redirected to Foo, but output of Foo is not
redirected to Bar.

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 improved your example a little bit - https://run.dlang.io/is/yeKofN,
it's really great. Need polish of course, but this is a way to get more
inheritance with structures.