On Sunday, 9 February 2014 at 12:36:38 UTC, Dicebot wrote:
On Sunday, 9 February 2014 at 04:14:05 UTC, Marco Leise wrote:
It depends on what syntax you expect. I solved it this way:

void fun(alias length)(void* sneaky = alloca(length));

void foo()
{
   size_t myLength = 42;
   fun!myLength();
}

Huge template bloat in current frontend state - new instance of `fun` for every single new function it is used in.

The implementation of `fun` can just forward `sneaky` onto another function. Cue some simple inlining and there is no bloat (at runtime, anyhow).

Reply via email to