What's the state of std.experimental.typecons.{wrap/unwrap} ?
sighoya
sighoya at gmail.com
Thu May 20 20:19:47 UTC 2021
Link to page:
https://dlang.org/phobos/std_experimental_typecons.html
I'm very interested in auto wrapping of structs/classes to
interfaces as it would aid to close the gap of structs to classes
regarding interface conformity.
Further, it would allow D to strive for the route of existentials
(a.k.a. boxes) as duality to generics/templates.
In the end, it would help D to become much more uniform, I think.
What's the actual the state of structural wrapping/unwrapping?
There are further things which irk me a bit:
>If Source is a struct then wrapping/unwrapping will create a
>copy; it is not possible to affect the original struct through
>the wrapper.
I would expect this to be the case. However, what about ref
structs, can they be supported, too?
>Source can be either a class or a struct,
Why not interfaces, too?
>allSatisfy!(isInterface, Targets)
Why not classes, too?
More information about the Digitalmars-d
mailing list