static code generation

anonymous anonymous at example.com
Sun Dec 16 03:19:58 PST 2012


On Sunday, 16 December 2012 at 08:49:10 UTC, js.mdnq wrote:
> On Sunday, 16 December 2012 at 06:38:13 UTC, anonymous wrote:
>> On Saturday, 15 December 2012 at 16:32:27 UTC, r_m_r wrote:
>>> On 12/15/2012 08:57 PM, anonymous wrote:
>>>> Note that here s1alpha and s2alpha are distinct types.
>>>
>>> what about this: http://dpaste.dzfl.pl/95f7a74d
>>
>> Consider
>>
>> struct Foo {mixin (genStruct!("s1"));}
>> struct Bar {mixin (genStruct!("s1"));}
>>
>> Foo.s1alpha and Bar.s1alpha are the same type. In my version 
>> they are not.
>
>
> Yes, they should be the same type. If you are inserting an 
> actual struct with the same name("s1") then you would expect 
> them to be identical.

I would not, actually. I'd expect it to behave like this:

struct Foo {struct s1 {}}
struct Bar {struct s1 {}}

and not like this:

struct s1 {}
struct Foo {alias .s1 s1;}
struct Bar {alias .s1 s1;}

However, if the alias version makes more sense in your case, by 
all means, use that one.


More information about the Digitalmars-d-learn mailing list