partialShuffle only shuffles subset.

2015-05-19 Thread BlackEdder via Digitalmars-d-learn
The documentation seems to indicate that partialShuffle: Partially shuffles the elements of r such that upon returning r[0..n] is a random subset of r, (which is what I want), but it seems that partialShuffle actually only shuffles the first subset of the range (which you could do probably also

Re: ddoc template error

2015-01-20 Thread BlackEdder via Digitalmars-d-learn
On Tuesday, 20 January 2015 at 09:38:55 UTC, Mathias LANG wrote: On Tuesday, 20 January 2015 at 08:55:58 UTC, BlackEdder wrote: Solved it. I had a _fromJSON comment somewhere else in the file and the underscore causes ddoc to fail If you could reduce it to a manageable size and post it to h

Re: ddoc template error

2015-01-20 Thread BlackEdder via Digitalmars-d-learn
Solved it. I had a _fromJSON comment somewhere else in the file and the underscore causes ddoc to fail On Monday, 19 January 2015 at 20:47:42 UTC, BlackEdder wrote: I'm trying to use ddoc to generate documentation, but get the following error: $ dub -b docs Building configuration "library", bu

ddoc template error

2015-01-19 Thread BlackEdder via Digitalmars-d-learn
I'm trying to use ddoc to generate documentation, but get the following error: $ dub -b docs Building configuration "library", build type docs Running dmd... source/painlessjson.d(287): Error: template painlessjson.fromJSON(T)(JSONValue json) unmatched --- in DDoc comment FAIL . painlessjson s

Re: Associative array to Struct at compile time

2014-07-25 Thread BlackEdder via Digitalmars-d-learn
On Friday, 25 July 2014 at 15:48:54 UTC, John Colvin wrote: On Friday, 25 July 2014 at 15:25:43 UTC, BlackEdder wrote: Is it possible to automatically convert an associative array to a struct? Basically I want to do the following (for any struct). struct A { double x = 1; } double[string]

Associative array to Struct at compile time

2014-07-25 Thread BlackEdder via Digitalmars-d-learn
Is it possible to automatically convert an associative array to a struct? Basically I want to do the following (for any struct). struct A { double x = 1; } double[string] aa = ["x":1]; auto a = toStruct!A( aa ); I've been trying to do this at compile time, but can't work out how setMember