Who's using structs nested in functions?

bearophile bearophileHUGS at lycos.com
Thu Oct 22 07:25:37 PDT 2009


Andrei Alexandrescu:

> With nested structs, however, you can't do much. You can pass them to a 
> template, but I can't see some solid use cases there. My understanding 
> is that nested structs have been implemented for completeness and 
> consistency with nested classes.
> Any good example of nested struct uses?

I have used nested static structs sometimes, when I need a struct just inside a function (like the main()) to avoid polluting the outer scope with the struct name.

Do you want to remove them from D2?

Bye,
bearophile



More information about the Digitalmars-d mailing list