On Monday, 4 September 2017 at 20:54:27 UTC, EntangledQuanta
wrote:
On Monday, 4 September 2017 at 09:23:24 UTC, Andrea Fontana
wrote:
On Thursday, 31 August 2017 at 23:17:52 UTC, EntangledQuanta
wrote:
Generally one has to use a switch to map dynamic components.
Given a set X and Y one can
On Monday, 4 September 2017 at 09:23:24 UTC, Andrea Fontana wrote:
On Thursday, 31 August 2017 at 23:17:52 UTC, EntangledQuanta
wrote:
Generally one has to use a switch to map dynamic components.
Given a set X and Y one can form a switch to map X to Y:
[...]
Does this work for you?
On Thursday, 31 August 2017 at 23:17:52 UTC, EntangledQuanta
wrote:
Generally one has to use a switch to map dynamic components.
Given a set X and Y one can form a switch to map X to Y:
[...]
Does this work for you?
https://dpaste.dzfl.pl/e2669b595539
Andrea
I came up with a library solution that isn't pretty ;/
I offer it up to the gods, but being gods, they probably don't
care.
template EnumMapper(alias func, string[] args, eT...)
{
import std.meta, std.typecons, std.traits, std.string,
std.algorithm, std.array, std.conv;
private
Generally one has to use a switch to map dynamic components.
Given a set X and Y one can form a switch to map X to Y:
switch(X)
{
case x1 : y1; break;
case x1 : y1;
}
Is there any easier way to do this where one simply specifies the
set's rather than having to create a switch