QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteI don't get the delegate:See the example again Mon Dec 23, 13 08:36 PMI see.RngDelegate rand = prng.NextDouble;is likestd::function rand = enginine.operator();I though that rand was a float (the return type of the NextDouble member function), but you're passing an engine to BoxMullerII.Nice!There are two issues that are confusing (there are two 'levels'):1. Server code e.g. the Box-Muller that contains a delegate type [std::function rand = engine.operator();]2. Clienct code that must assign the delegate type to a target method [RngDelegate rand = prng.NextDouble;]So the two C++ and C# are exactly the same but numerics in .NET with generic types is a non-starter. So I use double.
Last edited by Cuchulainn
on December 23rd, 2013, 11:00 pm, edited 1 time in total.