On Mon, Apr 28, 2014 at 8:20 PM, Dicebot via Digitalmars-d-learn
wrote:
> You can do the same iterating directly over allMembers list, why would you
> prefer array here?
Hmm, indeed. One advantage would be to get a range, and thus the power
and filtering, mapping and co.
On Monday, 28 April 2014 at 17:40:54 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Mon, Apr 28, 2014 at 5:45 PM, Andrej Mitrovic via
Digitalmars-d-learn wrote:
If you need to store the tuple as an array to some variable,
then you
would use that syntax. It all depends on what you're tr
On Mon, Apr 28, 2014 at 5:45 PM, Andrej Mitrovic via
Digitalmars-d-learn wrote:
> If you need to store the tuple as an array to some variable, then you
> would use that syntax. It all depends on what you're trying to do from
> the call site. Ultimately it won't matter much once we finally get a
>
On 4/28/14, ParticlePeter via Digitalmars-d-learn
wrote:
> I found the code with parenthesis in the dlang __traits docs and
> also Philippe Sigauds "D Templates", and I haven't seen any other
> example which works without them. So, when to use which syntax (
> for which purpose ) ?
If you need to
On Monday, 28 April 2014 at 13:57:56 UTC, Andrej Mitrovic wrote:
On Monday, 28 April 2014 at 13:52:52 UTC, ParticlePeter wrote:
DMD tells me "Error: variable m cannot be read at compile
time", but why ?
Because 'static foreach' is not an explicit feature yet, so it
depends on the context. Whe
On Monday, 28 April 2014 at 13:52:52 UTC, ParticlePeter wrote:
DMD tells me "Error: variable m cannot be read at compile
time", but why ?
Because 'static foreach' is not an explicit feature yet, so it
depends on the context. When you wrap the trait via:
[__traits(allMembers, MyStruct)]
You'
DMD tells me "Error: variable m cannot be read at compile time",
but why ?
[code]
struct MyStruct {
float float_value = 0.0f ;
ubyte ubyte_value = 2 ;
}
enum members = [ __traits( allMembers , MyStruct ) ] ;
foreach( m ; members ) {
mixin( "writeln( " ~ m ~ " , \" : \" , ( My