Re: Picking function templates with __traits(getOverloads, ..., true)

2020-07-29 Thread Jean-Louis Leroy via Digitalmars-d-learn
On Thursday, 30 July 2020 at 00:27:49 UTC, user1234 wrote: On Wednesday, 29 July 2020 at 23:57:21 UTC, Jean-Louis Leroy wrote: This works: [...] I may be missing the obvious...or it's a compiler bug??? Yes and it's just been fixed, see https://github.com/dlang/dmd/pull/11431. So

Re: Picking function templates with __traits(getOverloads, ..., true)

2020-07-29 Thread user1234 via Digitalmars-d-learn
On Wednesday, 29 July 2020 at 23:57:21 UTC, Jean-Louis Leroy wrote: This works: [...] I may be missing the obvious...or it's a compiler bug??? Yes and it's just been fixed, see https://github.com/dlang/dmd/pull/11431. So uncommenting the second times works on ~master.

Picking function templates with __traits(getOverloads, ..., true)

2020-07-29 Thread Jean-Louis Leroy via Digitalmars-d-learn
This works: module test; void foo(T)(T a, T b) {} void foo(T)(char a, T b) {} template InstantiateTemplateAt(alias Module, string name, int index, T...) { alias Template = __traits(getOverloads, test, name, true)[index]; alias InstantiateTemplateAt = Template!(T); } pragma(msg,

Re: is using predSwitch the only way to create to create recursive functions in D ?

2020-07-29 Thread Ali Çehreli via Digitalmars-d-learn
On 7/29/20 3:13 PM, Andy Balba wrote: ,, Not at all. The wording in the documentation is misleading. Recursive functions are as trivial as they are: int foo(uint i) { if (i == 0) { return 42; } return foo(i - 1); } void main() { assert(foo(7) == 42); } Ali

is using predSwitch the only way to create to create recursive functions in D ?

2020-07-29 Thread Andy Balba via Digitalmars-d-learn
,,

Re: dub build to generate different kinds of libs

2020-07-29 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 29 July 2020 at 17:42:20 UTC, jeff thompson wrote: On Wednesday, 29 July 2020 at 13:26:45 UTC, Andre Pany wrote: On Tuesday, 28 July 2020 at 22:10:58 UTC, jeff thompson wrote: On Tuesday, 28 July 2020 at 22:08:14 UTC, Steven Schveighoffer wrote: [...] Thanks Steve!, ya i know

Re: dub build to generate different kinds of libs

2020-07-29 Thread jeff thompson via Digitalmars-d-learn
On Wednesday, 29 July 2020 at 13:26:45 UTC, Andre Pany wrote: On Tuesday, 28 July 2020 at 22:10:58 UTC, jeff thompson wrote: On Tuesday, 28 July 2020 at 22:08:14 UTC, Steven Schveighoffer wrote: [...] Thanks Steve!, ya i know i can call build twice but i was wondering if there was any

Re: dub build to generate different kinds of libs

2020-07-29 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 28 July 2020 at 22:10:58 UTC, jeff thompson wrote: On Tuesday, 28 July 2020 at 22:08:14 UTC, Steven Schveighoffer wrote: On 7/28/20 5:50 PM, jeff thompson wrote: Hello Im brand new to D (loving it btw!) and have decided to build a largish windows project in the language. First