struct with @disable(d) default constructor doesn't work with arrays?

2012-08-22 Thread Minas Mina
I have this struct: struct S { int[] t; @disable this(); this(int sz) { t = new int[sz]; t[] = 1; } S opCall(int sz) { S s = S(sz); return s;

Re: struct with @disable(d) default constructor doesn't work with arrays?

2012-08-22 Thread bearophile
Minas Mina: I think it's a bug, what do you think? Search for it in Bugzilla. Maybe it's there already. Bye, bearophile

Re: struct with @disable(d) default constructor doesn't work with arrays?

2012-08-22 Thread Simen Kjaeraas
On Wed, 22 Aug 2012 13:09:49 +0200, bearophile bearophileh...@lycos.com wrote: Minas Mina: I think it's a bug, what do you think? Search for it in Bugzilla. Maybe it's there already. Bye, bearophile It is. #7021/#8457 -- Simen

std.widows.registry

2012-08-22 Thread Kai Meyer
If I try to modify a registry value with 'key.setValue()', I get an error 5, which I think is ERROR_ACCESS_DENIED. Even if I right click my .exe and choose 'run as Administrator'. I am on Windows 7 x64, and dmd 2.060. From my research, I think I have to modify my privilege tokens:

Link against MinGW libraries

2012-08-22 Thread Kai Meyer
There's got to be a way to link against libraries generated by MinGW, right? I'm using CMake to create a very simple 1 method library. If I tell D to link against the .lib (simple ar archive), it complains that it's an invalid library. If I tell D to link against the .dll, it complains that

Re: std.widows.registry

2012-08-22 Thread Kai Meyer
On Wednesday, 22 August 2012 at 14:52:00 UTC, Kai Meyer wrote: If I try to modify a registry value with 'key.setValue()', I get an error 5, which I think is ERROR_ACCESS_DENIED. Even if I right click my .exe and choose 'run as Administrator'. I am on Windows 7 x64, and dmd 2.060. From my

Re: Link against MinGW libraries

2012-08-22 Thread Maxim Fomin
On Wednesday, 22 August 2012 at 14:56:40 UTC, Kai Meyer wrote: There's got to be a way to link against libraries generated by MinGW, right? I'm using CMake to create a very simple 1 method library. If I tell D to link against the .lib (simple ar archive), it complains that it's an invalid

function pointer and default argument

2012-08-22 Thread Ellery Newcomer
hey. is this valid code? void func1(int i, double j = 1.0) { } void main() { auto fn = func1; func1(1); //dmd: ok fn(1); // dmd: not ok }

Re: function pointer and default argument

2012-08-22 Thread Ali Çehreli
On 08/22/2012 11:51 AM, Ellery Newcomer wrote: hey. is this valid code? void func1(int i, double j = 1.0) { } void main() { auto fn = func1; func1(1); //dmd: ok fn(1); // dmd: not ok } The type of the function pointer does not include the values of the default parameters. The type

Re: function pointer and default argument

2012-08-22 Thread Ellery Newcomer
On 08/22/2012 12:03 PM, Ali Çehreli wrote: On 08/22/2012 11:51 AM, Ellery Newcomer wrote: hey. is this valid code? void func1(int i, double j = 1.0) { } void main() { auto fn = func1; func1(1); //dmd: ok fn(1); // dmd: not ok } The type of the function pointer does not

Re: function pointer and default argument

2012-08-22 Thread Jonathan M Davis
On Wednesday, August 22, 2012 11:51:45 Ellery Newcomer wrote: hey. is this valid code? void func1(int i, double j = 1.0) { } void main() { auto fn = func1; func1(1); //dmd: ok fn(1); // dmd: not ok } Default arguments are not part of the type. This behavior is very much on

Re: function pointer and default argument

2012-08-22 Thread Ali Çehreli
On 08/22/2012 12:15 PM, Ellery Newcomer wrote: On 08/22/2012 12:03 PM, Ali Çehreli wrote: On 08/22/2012 11:51 AM, Ellery Newcomer wrote: hey. is this valid code? void func1(int i, double j = 1.0) { } void main() { auto fn = func1; func1(1); //dmd: ok fn(1); // dmd: not ok } The

Re: SSE2 movddup Not Moving Values

2012-08-22 Thread bearophile
Jonathan Crapuchettes: Might anyone from this forum have some thoughts for this problem? http://stackoverflow.com/questions/12082561/sse2-movddup-not-moving-values There are some mistakes in that asm code: import core.stdc.stdio: printf; import core.cpuid: sse3; void main() {

Re: Link against MinGW libraries

2012-08-22 Thread Mike Parker
On 8/22/2012 11:56 PM, Kai Meyer wrote: There's got to be a way to link against libraries generated by MinGW, right? I'm using CMake to create a very simple 1 method library. If I tell D to link against the .lib (simple ar archive), it complains that it's an invalid library. If I tell D to link