classes inside functions?!

Sean Kelly sean at f4.ca
Sun Apr 30 02:57:17 PDT 2006


Hasan Aljudy wrote:
> I don't know if this is a bug or what, but for some reason, dmd allows 
> you to define classes/structs/unions/enums as statements inside function 
> bodies.
> Oddly enough, you cannot define a template in the same way
> 
> I didn't find in the docs any mention of whether aggregates are allowed 
> inside function bodies or not.
> 
> Walter, is this the correct behaviour?

It is.  Templates are merely a special case as they must have external 
linkage.


Sean



More information about the Digitalmars-d mailing list