Nightly builds

2012-01-02 Thread simendsjo
Is it possible for the autotester to allow downloading the latest build that passed testing?

rvalue references template ?

2012-01-02 Thread Joshua Reusch
Is it possible to create a template turning any value into a lvalue? This would be helpful if a function expects a reference but you dont need the result of the change: ///decode(S)(in S str, ref size_t index); auto c = std.utf.decode(some_string, lval!0);

Re: rvalue references template ?

2012-01-02 Thread Timon Gehr
On 01/02/2012 03:02 PM, Joshua Reusch wrote: Is it possible to create a template turning any value into a lvalue? This would be helpful if a function expects a reference but you dont need the result of the change: ///decode(S)(in S str, ref size_t index); auto c = std.utf.decode(some_string,

Re: rvalue references template ?

2012-01-02 Thread Simen Kjærås
On Mon, 02 Jan 2012 15:02:30 +0100, Joshua Reusch yos...@arkandos.de wrote: Is it possible to create a template turning any value into a lvalue? This would be helpful if a function expects a reference but you dont need the result of the change: ///decode(S)(in S str, ref size_t index);

Re: rvalue references template ?

2012-01-02 Thread Joshua Reusch
Am 02.01.2012 22:13, schrieb Simen Kjærås: On Mon, 02 Jan 2012 15:02:30 +0100, Joshua Reusch yos...@arkandos.de wrote: Is it possible to create a template turning any value into a lvalue? This would be helpful if a function expects a reference but you dont need the result of the change:

Array of array

2012-01-02 Thread RenatoL
auto r = new int[][5]; this is ok auto r = new int[][]; this is not ok Error: new can only create structs, dynamic arrays or class objects , not int[][]'s why?

Re: Array of array

2012-01-02 Thread Timon Gehr
On 01/02/2012 11:04 PM, RenatoL wrote: auto r = new int[][5]; this is ok auto r = new int[][]; this is not ok Error: new can only create structs, dynamic arrays or class objects , not int[][]'s why? What would you expect the code to do? What you are trying to achieve is similar to: class

Re: Array of array

2012-01-02 Thread RenatoL
Just curious... the answer of the compiler it's a bit unclear to me... T[] is a dynamic array of type T. T[][] is a dynamic array of T[]. But this doesn't work. Why?

Re: Array of array

2012-01-02 Thread Timon Gehr
On 01/02/2012 11:21 PM, RenatoL wrote: Just curious... the answer of the compiler it's a bit unclear to me... T[] is a dynamic array of type T. T[][] is a dynamic array of T[]. But this doesn't work. Why? It does work. Why do you think it does not? T[] a; // ok T[][] b;

Hole of new? (Re: Array of array)

2012-01-02 Thread Mafi
Am 02.01.2012 23:33, schrieb Timon Gehr: On 01/02/2012 11:21 PM, RenatoL wrote: Just curious... the answer of the compiler it's a bit unclear to me... T[] is a dynamic array of type T. T[][] is a dynamic array of T[]. But this doesn't work. Why? It does work. Why do you think it does not?

Re: Array of array

2012-01-02 Thread RenatoL
I have: auto r = new int[][]; Error: new can only create structs, dynamic arrays or class objects , not int[][]'s while auto r = new int[][3]; is ok.

Re: Array of array

2012-01-02 Thread Timon Gehr
On 01/03/2012 12:03 AM, RenatoL wrote: I have: auto r = new int[][]; Error: new can only create structs, dynamic arrays or class objects , not int[][]'s while auto r = new int[][3]; is ok. new int[][3] is an alternate form of new int[][](3); new int[][3] allocates an int[][] with 3

Re: Hole of new? (Re: Array of array)

2012-01-02 Thread Timon Gehr
On 01/03/2012 12:02 AM, Mafi wrote: Am 02.01.2012 23:33, schrieb Timon Gehr: On 01/02/2012 11:21 PM, RenatoL wrote: Just curious... the answer of the compiler it's a bit unclear to me... T[] is a dynamic array of type T. T[][] is a dynamic array of T[]. But this doesn't work. Why? It does

Re: Array of array

2012-01-02 Thread Matej Nanut
On 3 January 2012 00:27, Timon Gehr timon.g...@gmx.ch wrote: On 01/03/2012 12:03 AM, RenatoL wrote: I have: auto r = new int[][]; Error: new can only create structs, dynamic arrays or class objects , not int[][]'s while auto r = new int[][3]; is ok. new int[][3] is an alternate

Re: Array of array

2012-01-02 Thread Manfred Nowak
RenatoL wrote: Error: new can only create structs, dynamic arrays or class objects, not int[][]'s There is an error in the error message: new can only create _static_ arrays. -manfred

Re: Array of array

2012-01-02 Thread Jonathan M Davis
On Monday, January 02, 2012 23:49:36 Manfred Nowak wrote: RenatoL wrote: Error: new can only create structs, dynamic arrays or class objects, not int[][]'s There is an error in the error message: new can only create _static_ arrays. Um no. new is used for creating _dynamic_ arrays, not

Re: Array of array

2012-01-02 Thread Timon Gehr
On 01/03/2012 12:46 AM, Matej Nanut wrote: On 3 January 2012 00:27, Timon Gehr timon.g...@gmx.ch mailto:timon.g...@gmx.ch wrote: On 01/03/2012 12:03 AM, RenatoL wrote: I have: auto r = new int[][]; Error: new can only create structs, dynamic arrays or class

Re: Mixing D and C - Windows

2012-01-02 Thread DNewbie
Thank you both. I've created a D DLL [http://dlang.org/dll.html], then I've loaded it from a C program [compiled with dmc]. However, I'd want to be able to call it from a C program compiled with MSVC, and I got a link error - unresolved external symbol [link testdll.obj /implib:mydll.lib

Re: Array of array

2012-01-02 Thread Manfred Nowak
Jonathan M Davis wrote: new is used for creating _dynamic_ arrays, not static arrays. Correct, my fault. I meant something like statically initialized dynamic, because `new' currently needs an `uint' number to allocate some space for the elements of the outermost array. The posting shows,

Re: Mixing D and C - Windows

2012-01-02 Thread Mike Parker
On 1/3/2012 10:02 AM, DNewbie wrote: Thank you both. I've created a D DLL [http://dlang.org/dll.html], then I've loaded it from a C program [compiled with dmc]. However, I'd want to be able to call it from a C program compiled with MSVC, and I got a link error - unresolved external symbol

Re: Mixing D and C - Windows

2012-01-02 Thread Andrej Mitrovic
Maybe I'm wrong, but IIRC objconv won't work on import libs. But there are other ways to do it: http://support.microsoft.com/kb/131313

Re: Mixing D and C - Windows

2012-01-02 Thread DNewbie
Resolved. Thanks everyone. On Tue, Jan 3, 2012, at 04:49 AM, Andrej Mitrovic wrote: Maybe I'm wrong, but IIRC objconv won't work on import libs. But there are other ways to do it: http://support.microsoft.com/kb/131313 -- D