std.random question

tired_eyes via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 3 03:51:22 PDT 2015


> import std.random;
>
> struct Mystruct {
> 	int id;
> 	
> 	static opCall() {
> 		Mystruct s;
> 		s.id = uniform(0, 10);
> 		return s;
> 	}
> }
>
> void main() {
>     auto s = Mystruct();
> 	// whatever
> }
> ---

This make sense, thant you for the explanation.



More information about the Digitalmars-d-learn mailing list