Re: offsetof

2008-11-07 Thread Jarrett Billingsley
On Fri, Nov 7, 2008 at 11:38 PM, Tim M <[EMAIL PROTECTED]> wrote: > I tried 1.036 and had the same problem. I'm using the offsetof and sizeof in > a few constants which I've defined at the beginning of the file so I tried > moving to the end of the file and it is no longer in error. I read somewher

Re: offsetof

2008-11-07 Thread Tim M
I tried 1.036 and had the same problem. I'm using the offsetof and sizeof in a few constants which I've defined at the beginning of the file so I tried moving to the end of the file and it is no longer in error. I read somewhere that you don't have to forward declare everything in D like you

Problem using __traits

2008-11-07 Thread Daniel Ribeiro Maciel
I am having a problem trying to enumerate then call a method of a class. I have the following situation class Foo { void bar () { writefln( "hello" ); } } void traitsTest( TClass, string name )( TClass foo ) { foreach( method; __traits( allMembers, TClass ) ) { writefln( method );

Re: offsetof

2008-11-07 Thread Jarrett Billingsley
On Fri, Nov 7, 2008 at 8:59 PM, Tim M <[EMAIL PROTECTED]> wrote: > Did you find a sollution? I need to get the offset of a member of a struct > so I can port a .h to a .di but dmd complains that the member doesn't exist > on the struct. I dont think anyone has ever tried the code at: > http://www.d

Re: offsetof

2008-11-07 Thread Tim M
Did you find a sollution? I need to get the offset of a member of a struct so I can port a .h to a .di but dmd complains that the member doesn't exist on the struct. I dont think anyone has ever tried the code at: http://www.digitalmars.com/d/1.0/ctod.html#fieldoffset On Fri, 22 Aug 2008 10

Re: Function overload pointers

2008-11-07 Thread Daniel Ribeiro Maciel
Oh, sorry, I did not express myself correctly. What I actually meant was, I need to enumerate all "foo"'s overloads, but "foo" is not class methods, its a set of standalone functions. I need to do that in order to properly bind those overloads automatically to a scripting language. My final goa

Re: Function overload pointers

2008-11-07 Thread Christopher Wright
Daniel Ribeiro Maciel wrote: I'm having a problem to pass function overload pointers. I have the following situation: void foo() { writefln( "hello" ); } void foo(int i) { writefln( "hello 1 int ", i ); } void foo(int i, int j) { writefln( "hello 2 int ", i, " ", j ); } I need to be able to bu

Re: How are 2D static arrays allocated?

2008-11-07 Thread ore-sama
Jarrett Billingsley Wrote: > You.. can't actually allocate a static array on the heap using new. > At least not directly. It's kind of an embarrassing hole in the > syntax. In fact, I'm not sure if you can even get a static array to > point onto the heap, since a static array "reference" is trea

Re: c style coding on dmd

2008-11-07 Thread ore-sama
Jarrett Billingsley Wrote: > Long story short - why use D if you aren't going to be able to take > advantage of the very things that make it cool? Not only GC makes it cool. D has a number of other features.