<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 12 May 2013 15:41, Rel <span dir="ltr"><<a href="mailto:relmail@rambler.ru" target="_blank">relmail@rambler.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Benjamin Thaut, yes I know. but here is an example, if I add a class to the code like that:<div class="im"><br>
<br>
module main;<br>
<br>
extern (C) void* _Dmodule_ref = null;<br></div>
extern (C) void printf(const char*, ...);<div class="im"><br>
extern (C) void puts(const char*);<br>
extern (C) void exit(int);<br>
<br></div>
class A {<br>
int a = 100;<br>
int b = 200;<div class="im"><br>
};<br>
<br>
extern (C) void main() {<br>
scope(exit) {<br>
puts("Exiting!");<br>
exit(0);<br>
}<br>
<br></div>
A a; printf("%d %d\n", a.a, a.b);<br>
}<br clear="all"></blockquote></div><br></div><div class="gmail_extra">This code won't work. classes are reference types and need to be initialised with 'new'. This requires TypeInfo_Class information to do... You could possible use 'scope A a = new A'. But again your going into the bounds of needing rtti for the initialiser var to assign it on the stack.<br>
<br></div><div class="gmail_extra">Structs would be your friend here...<br></div><div class="gmail_extra"><br>-- <br>Iain Buclaw<br><br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>