Is it possible to do such thing without using string mixin?
import std.stdio;
import std.metastrings;
struct Key(T...)
{
static string declareFields() // compile-time
{
string declaration;
foreach (index, type; T)
> Or do you really need assignField to work with runtime values ?
Yes, that's the problem.
Did it just for fun, maybe it will help someone :)
Requires UniLink:
ftp://ftp.styx.cabel.net/pub/UniLink
main.d
extern(C)
void _acrtused_con()
{
mainFunc();
}
extern(Windows)
{
int MessageBoxA(uint hWnd, char* lpText, char* lpCaption, uint
uType);
void ExitPro
Is it bug or feature? :)
class Foo
{
int i;
struct Bar
{
int j;
int foobar()
{
return i + j;
}
}
}
main.d(ХХ): Error: this for i needs to be type Foo not type Bar
On Monday, 6 August 2012 at 21:51:24 UTC, Andrej Mitrovic wrote:
There is no "outer". A nested struct has the same access as a
nested
static class, meaning no access to any outer members unless
they're
static.
Is there somewhere I can read the rationale behind that decision?
On Monday, 6 August 2012 at 23:42:45 UTC, Era Scarecrow wrote:
On Monday, 6 August 2012 at 22:28:40 UTC, RivenTheMage wrote:
On Monday, 6 August 2012 at 21:51:24 UTC, Andrej Mitrovic
wrote:
There is no "outer". A nested struct has the same access as a
nested static class, meaning
This is infinite loop:
for (ubyte i=0; i<=255; i++)
{
...
}
I guess it's a bug?
On Saturday, 11 August 2012 at 18:37:18 UTC, Adam D. Ruppe wrote:
A ubyte is ALWAYS <=255, since ubyte 255 + 1 == 0.
Isn't both "i" and "255" should be propagated to
int before comparison?
On Saturday, 11 August 2012 at 19:18:14 UTC, RivenTheMage wrote:
On Saturday, 11 August 2012 at 18:37:18 UTC, Adam D. Ruppe
wrote:
A ubyte is ALWAYS <=255, since ubyte 255 + 1 == 0.
Isn't both "i" and "255" should be propagated to
int before comparison?
Implicitly propagated, I mean.
Okay, thanks for helping!
10 matches
Mail list logo