templatized delegate

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 23 03:30:56 PDT 2017


On Monday, 22 May 2017 at 21:44:17 UTC, ag0aep6g wrote:
> With that kind of variadics, you're not dealing with a 
> template. A (run-time) variadic delegate is an actual delegate, 
> i.e. a value that can be passed around. But the variadic stuff 
> is a bit weird to use, and probably affects performance.

By the way, I'm not even sure, if variadics work in my case. I 
have a strange struct of a random generator, which cannot be 
copied, and I have no idea how to pass it to a variadic function:

import std.stdio;
import mir.random;

void main()
{
	Random rndGen = Random(unpredictableSeed);
	fun(rndGen);
}

void fun(...)
{

}

Yields "... is not copyable because it is annotated with 
@disable" :)


More information about the Digitalmars-d-learn mailing list