On 02/09/13 17:02, Artur Skawina wrote:
I'm not sure where the delegates are supposed to be defined, the above
allows defining then externally. If that is not required and you only
need to select them from a set of predefined internal ones, then you can
use your original code with something like:

     private void function() _jump;
     private void jump() { void delegate() dg; dg.ptr=&this; dg.funcptr=_jump; 
dg(); }
     this(size_t max)
     {
         _max = max;
         _jump = (&jump10).funcptr;
     }

That way `jump10` (and any other such functions) can still use the implicit-
'this'.

This second solution may actually rescue my revision to RandomSample -- I'm going to try it out. :-)

Reply via email to