Re: Getting the overload set of a template

2018-04-22 Thread Alex via Digitalmars-d-learn
On Monday, 23 April 2018 at 00:26:23 UTC, Simen Kjærås wrote: // tuple("Has foo1_A") pragma(msg, __traits(getAttributes, foo1!"a")); // tuple("Has foo1_A") pragma(msg, __traits(getAttributes, foo2!"a")); // tuple("Has foo1_B") pragma(msg, __traits(getAttributes, foo1!"b")); // tuple("Has

Re: Getting the overload set of a template

2018-04-22 Thread Simen Kjærås via Digitalmars-d-learn
On Sunday, 22 April 2018 at 19:27:24 UTC, Alex wrote: On Sunday, 22 April 2018 at 18:25:29 UTC, Simen Kjærås wrote: No lowering occurs here. A lowering is when the compiler takes one piece of syntax and replaces it with a different one, usually one that's more verbose. In a way, it's kind of

Re: Getting the overload set of a template

2018-04-22 Thread Alex via Digitalmars-d-learn
On Sunday, 22 April 2018 at 18:25:29 UTC, Simen Kjærås wrote: No lowering occurs here. A lowering is when the compiler takes one piece of syntax and replaces it with a different one, usually one that's more verbose. In a way, it's kind of like a template being instantiated, in that you write

Re: Getting the overload set of a template

2018-04-22 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 21 April 2018 at 21:10:29 UTC, Alex wrote: On Saturday, 21 April 2018 at 19:51:05 UTC, Simen Kjærås wrote: On Saturday, 21 April 2018 at 11:23:33 UTC, Alex wrote: So, do you mean, that the constraint belongs to the interface of a template? Not necessarily - it depends on what

Re: Advice on : rmdirRecurse and setAttributes in Windows

2018-04-22 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 21 April 2018 at 18:39:02 UTC, Vino wrote: Hi All, The function rmdirRecurse does not work in Windows if the file has the READ ONLY permission, so to over come this issue, i have written the below function to set the permission on file and folder using the function

Re: ldc flags for beginner

2018-04-22 Thread Michael via Digitalmars-d-learn
On Sunday, 22 April 2018 at 02:08:40 UTC, fevasu wrote: what flags to use so that the intermediate .o files are discared by ldc and only a.out is written to disk You can also use rdmd with ldc, if that makes things easier.

Re: ldc flags for beginner

2018-04-22 Thread kinke via Digitalmars-d-learn
On Sunday, 22 April 2018 at 14:05:53 UTC, kinke wrote: On Sunday, 22 April 2018 at 02:08:40 UTC, fevasu wrote: what flags to use so that the intermediate .o files are discared by ldc and only a.out is written to disk There's no such functionality, the .o files are required as linker input.

Re: ldc flags for beginner

2018-04-22 Thread kinke via Digitalmars-d-learn
On Sunday, 22 April 2018 at 02:08:40 UTC, fevasu wrote: what flags to use so that the intermediate .o files are discared by ldc and only a.out is written to disk There's no such functionality, the .o files are required as linker input. You can place the object files into some temp dir with

Re: dynamically allocating on the stack

2018-04-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/22/18 3:17 AM, Cym13 wrote: On Sunday, 22 April 2018 at 05:29:30 UTC, Mike Franklin wrote: On Sunday, 22 April 2018 at 00:41:34 UTC, Nicholas Wilson wrote: You're not using the C library version of it, the compiler does the stack space reservation inline for you. There is no way around

Re: dynamically allocating on the stack

2018-04-22 Thread Giles Bathgate via Digitalmars-d-learn
On Sunday, 22 April 2018 at 05:29:30 UTC, Mike Franklin wrote: I'm not convinced. I did some no-runtime testing and eventually found the implementation in druntime here It seems to me that it's an odd thing to have what apparently looks like a function call an intrinsic part of the language.

Re: dynamically allocating on the stack

2018-04-22 Thread Cym13 via Digitalmars-d-learn
On Sunday, 22 April 2018 at 05:29:30 UTC, Mike Franklin wrote: On Sunday, 22 April 2018 at 00:41:34 UTC, Nicholas Wilson wrote: You're not using the C library version of it, the compiler does the stack space reservation inline for you. There is no way around this. I'm not convinced. I did

Re: static array of pointers to dynamic arrays of ints problem...

2018-04-22 Thread Neia Neutuladh via Digitalmars-d-learn
On Sunday, 22 April 2018 at 06:00:15 UTC, WhatMeForget wrote: foreach(i, elem; a) { int[] temp = new int[](5); .. a[i] = } You're taking the address of a local variable and persisting it beyond the variable's scope. This is not safe in general; compilers

static array of pointers to dynamic arrays of ints problem...

2018-04-22 Thread WhatMeForget via Digitalmars-d-learn
Surely a stupid mistake on my part, but why is the first array repeated? import std.stdio; void main() { int[]*[2] a; // a static arrray holding pointers to dynamic arrays static int unique = 0; foreach(i, elem; a) { int[] temp = new int[](5); foreach(ref