On Saturday, 14 January 2017 at 16:05:33 UTC, Ignacious wrote:
Go join the Nazi Youth group, you OSS Sympathizer!
What?
On Saturday, 14 January 2017 at 11:32:10 UTC, Marc Schütz wrote:
You can utilize a little-known `switch` syntax trick in
combination with `foreach`. Because a `foreach` over tuples is
unrolled at compile time, it works even if your fields don't
have exactly the same types:
On Saturday, 14 January 2017 at 08:30:04 UTC, Meta wrote:
On Saturday, 14 January 2017 at 05:29:49 UTC, Nicholas Wilson
wrote:
enum XX
{
X = Q.X.offsetof,
Y = Q.Y.offsetof
//ect.
}
and then
*(cast(void*)(this) + x) = e; //if inside struct/class
or
*(cast(void*)(q) + x) = e; // if
On Saturday, 14 January 2017 at 11:32:10 UTC, Marc Schütz wrote:
You can utilize a little-known `switch` syntax trick in
combination with `foreach`. Because a `foreach` over tuples is
unrolled at compile time, it works even if your fields don't
have exactly the same types:
That looks
You can utilize a little-known `switch` syntax trick in
combination with `foreach`. Because a `foreach` over tuples is
unrolled at compile time, it works even if your fields don't have
exactly the same types:
--
struct Foo {
int
On Saturday, 14 January 2017 at 05:29:49 UTC, Nicholas Wilson
wrote:
enum XX
{
X = Q.X.offsetof,
Y = Q.Y.offsetof
//ect.
}
and then
*(cast(void*)(this) + x) = e; //if inside struct/class
or
*(cast(void*)(q) + x) = e; // if outside
Unfortunately this loses you `@safe`ty, but as
On Saturday, 14 January 2017 at 03:20:24 UTC, Ignacious wrote:
When doing common functionality for a switch, is there any way
to optimize:
switch(x)
{
case X:
q.X = e;
break;
case Y:
q.Y = e;
break
etc...
}
e is basically a value that, depending