Template conflict?

2009-02-14 Thread Mike L.
Can anybody explain why I get the following error: test.d(28): Error: test.tblahTemplate!(uint).tblah at test.d(13) conflicts with test.tblahTemplate!(int).tblah at test.d(13) When I try to compile this?: test.d: int blah(uint x) { return x; } int blah(int x) { return (x >= 0 ?

Re: Pointers

2009-02-14 Thread Chris Nicholson-Sauls
Eugene Y. wrote: class C { } If I declare an instance of class C C cinstance = new C(); is cinstance a pointer or is it like C++? I'm wondering this because I tested with DMD 2.008 and if I do this It is a reference. I'm not sure off the top of my head whether its a direct pointer or a han

Pointers

2009-02-14 Thread Eugene Y.
class C { } If I declare an instance of class C C cinstance = new C(); is cinstance a pointer or is it like C++? I'm wondering this because I tested with DMD 2.008 and if I do this C dinstance = cinstance; it doesn't seem to copy by value but by reference just like copying pointers in C/C++. I

d in osx

2009-02-14 Thread jstark
hello, i just downloaded d for osx (at last :)), but when i try to compile a simple prog, i get the followin msg: object.d: module object cannot read file 'object.d' i have 'dmd', 'obj2asm', and 'dumpobj' in $HOME/local/bin, libphobos2.a in $HOME/local/lib. Where should i copy 'src' and what t

d in osx

2009-02-14 Thread jstark
hello, i just downloaded d for osx (at last :)), but when i try to compile a simple prog, i get the followin msg: object.d: module object cannot read file 'object.d' i have 'dmd', 'obj2asm', and 'dumpobj' in $HOME/local/bin, libphobos2.a in $HOME/local/lib. Where should i copy 'src' and what t

Re: return *(cast(T*)vPtr) and OutOfMemoryException

2009-02-14 Thread TSalm
Excellent explication ! Thank you Frits Le Sat, 14 Feb 2009 17:58:35 +0100, Frits van Bommel a écrit: TSalm wrote: Hello, In the code below, why the first Stdout throws a Exception when the second doesn't ? /* CODE */ import tango.io.Stdout; struct VoidPtr(T) {

Re: return *(cast(T*)vPtr) and OutOfMemoryException

2009-02-14 Thread Frits van Bommel
TSalm wrote: Hello, In the code below, why the first Stdout throws a Exception when the second doesn't ? /* CODE */ import tango.io.Stdout; struct VoidPtr(T) { void* vPtr; void value(T val) { vPtr = &val; Here you're storing a pointer to a non-ref parameter

return *(cast(T*)vPtr) and OutOfMemoryException

2009-02-14 Thread TSalm
Hello, In the code below, why the first Stdout throws a Exception when the second doesn't ? /* CODE */ import tango.io.Stdout; struct VoidPtr(T) { void* vPtr; void value(T val) { vPtr = &val; } T value() { return *(cast(T*)vPtr); } } void main(

Dependency check

2009-02-14 Thread Qian Xu
Hi All, Is there any tools to check dependency of d projects? I want to remove all unnecessary imports, to make the build process more faster :-) Best regards --Qian