On 12/25/2012 02:06 AM, Zhenya wrote:
Is it correct,that this code doesn't compile:
check this: http://dpaste.dzfl.pl/eec6d152
regards,
r_m_r
(!__traits(compiles, b._bar));
}
//Compiled like so (to avoid linker errors):
$ dmd -lib foo.d -oflibfoo.a
$ dmd main.d -L-L. -L-lfoo
$ ./main
regards,
r_m_r
On 12/25/2012 07:42 AM, r_m_r wrote:
assert(!__traits(compiles, b._bar));
sorry, i made a typo: it should be bar_ instead of _bar.
Interestingly, the below assertion fails at run time:
assert(!__traits(compiles, b.bar_));
but this won't compile (as expected):
assert(b.bar_ == 20
(!__traits(compiles, b.bar_));
the assertion below executes without errors (as expected):
assert(!__traits(compiles, b.bar_ == 20));
regards,
r_m_r
On 12/21/2012 10:30 AM, r_m_r wrote:
http://wiki.dlang.org/Combining_Structs)
the link should be: http://wiki.dlang.org/Combining_structs
regards,
r_m_r
perspective).
BTW if you find any interesting alternative, please consider adding it
to the dwiki - http://wiki.dlang.org/ (for e.g.:
http://wiki.dlang.org/Combining_Structs)
regards,
r_m_r
been very simple if ``multiple alias this'' was available).
regards,
r_m_r
://dpaste.dzfl.pl/d8faa96a
http://dpaste.dzfl.pl/fc88273b
regards,
r_m_r
approach1).
regards,
r_m_r
On 12/16/2012 02:03 PM, js.mdnq wrote:
That looks like it might be pretty close. I was also thinking that one
could just use mixin templates of trying to do it with structs directly.
i dunno if this is what u want, but have a look:
http://dpaste.dzfl.pl/f5616d77
cheers,
r_m_r
for some details:
http://forum.dlang.org/thread/k75guj$16pk$1...@digitalmars.com
regards,
r_m_r
On 12/10/2012 01:43 AM, anonymous wrote:
Maybe it helps if you see it in action: http://dpaste.dzfl.pl/5d4cb742
Here's a slightly modified version: http://dpaste.dzfl.pl/f2bd1428
regards,
r_m_r
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
regards,
r_m_r
On 12/10/2012 01:24 AM, js.mdnq wrote:
which will fail or not be what I want, since I want to generate the
structs s1 and s1.
how about this: http://dpaste.dzfl.pl/c0325def
regards,
r_m_r
On 12/16/2012 04:00 AM, js.mdnq wrote:
Now, the next step is to be able to insert code into the struct! ;)
how about this: http://dpaste.dzfl.pl/8161d00a
regards,
r_m_r
On 12/16/2012 05:30 AM, js.mdnq wrote:
and mixin the UserStruct.S with the MasterStruct_A
this is the closest I can get: http://dpaste.dzfl.pl/9d11d060
regards,
r_m_r
On 12/16/2012 06:36 AM, r_m_r wrote:
this is the closest I can get: http://dpaste.dzfl.pl/9d11d060
Cleaned up a bit: http://dpaste.dzfl.pl/d9f001db
regards,
r_m_r
On 12/16/2012 12:08 PM, anonymous wrote:
Foo.s1alpha and Bar.s1alpha are the same type. In my version they are not.
OK. Fair Enough :-)
18 matches
Mail list logo