Nested Structs (Solution)
Max Samukha
maxsamukha at gmail.com
Wed Dec 12 16:37:15 PST 2012
On Thursday, 13 December 2012 at 00:02:01 UTC, js.mdnq wrote:
>
> Half done? Has it even been implemented at all?
http://dlang.org/class.html#nested
It is implemented for nested classes but not structs.
>
> In any case my method seems to provide a solution to the
> problem in the mean time. I have updated the code to work
> correct(had a small bug) and it uses an alias to make it easier
> to update in the future if D finally does support this
> construct in full.
>
> http://dpaste.dzfl.pl/64025e0a
>
> If outer is the appropriate keyword then Parent can easily be
> changed.
The name doesn't matter. I just wanted to annoy Walter again with
yet another bit of evidence that completeness of a feature is
important even if it doesn't seem to have an obvious use case.
People will do what is logical and end up with hacks like that.
> Little would have to be done to the structs to make it work. In
> fact, the method should work if D ever decides to support such
> a feature with little change. Compile times could be increased
> though by removing the templating, but unfortunately that might
> require a lot of work. A mixin might simplify it.
More information about the Digitalmars-d
mailing list