How do I index a function parameter tuple with a run-time index?
On 15.01.2016 21:42, Nordlöw wrote:
How do I index a function parameter tuple with a run-time index?
With a switch and a static foreach:
void f(A...)(size_t i, A a)
{
import std.stdio: writeln;
switch_: switch (i)
{
foreach (iT, T; A)
{
case
On Friday, 15 January 2016 at 20:48:39 UTC, anonymous wrote:
On 15.01.2016 21:42, Nordlöw wrote:
How do I index a function parameter tuple with a run-time
index?
With a switch and a static foreach:
void f(A...)(size_t i, A a)
{
import std.stdio: writeln;
switch_: switch (i
On Friday, 15 January 2016 at 20:42:47 UTC, Nordlöw wrote:
How do I index a function parameter tuple with a run-time index?
I believe it's impossible because a parameter tuple is not a
runtime entity. If it was an expression tuple (a compile-time
tuple of only values, no types or symbols
On Fri, 15 Jan 2016 20:52:46 +, Meta wrote:
> And of course I'm proven wrong as soon as I post :) Sometimes I forget
> how powerful D's code generation abilities are.
Username doesn't check out, :(
On Friday, 15 January 2016 at 21:47:21 UTC, Justin Whear wrote:
On Fri, 15 Jan 2016 20:52:46 +, Meta wrote:
And of course I'm proven wrong as soon as I post :) Sometimes
I forget how powerful D's code generation abilities are.
Username doesn't check out, :(
Huh?