classes inside functions?!

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Mon May 1 07:29:47 PDT 2006


Sean Kelly wrote:
> 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

What do you mean by that? What is external linkage? Did you meant an 
extern(al) storage class? (I just found out now something I unknew, that 
are two distinct "extern" keywords/concepts in D)

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list