Alias delegates and @nogc

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 18 10:13:58 PST 2015


On Wed, 18 Feb 2015 19:09:50 +0300, Ivan Timokhin wrote:

> Is there any way to pass a delegate that:
> 1. avoids indirect calls (like alias);
> 2. does not allocate (like scope delegate);
> 3. captures local variables?

i don't think that you can do it. but what is wrong with delegate 
version? it doesn't really cost *that* much (especially if you'll 
remember that DMD optimiser is far from... well, optimal ;-), and if you 
really doing something where indirect function call matters, you'd better 
use mixins anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150218/397efe6c/attachment-0001.sig>


More information about the Digitalmars-d-learn mailing list