Re: Defining an alias to an overloaded function

2020-01-20 Thread Boris Carvajal via Digitalmars-d-learn
On Monday, 20 January 2020 at 22:02:54 UTC, olvy wrote: I'm learning D, and as an exercise, I'm trying to define a HashSet that would be a wrapper around an associative array with some dummy value type. This seems to work: ... struct RangeImpl(T) { alias byKeyRetType = typeof(byK

Re: Type Inference and Try Blocks

2020-01-20 Thread user1234 via Digitalmars-d-learn
On Monday, 20 January 2020 at 23:16:07 UTC, Henry Claesson wrote: This isn't a D-specific "problem", but there may be D-specific solutions. I have a function `doSomething()` that returns a Voldemort type, and this same function also throws. So, there's this: try { auto foo = doSomething();

Re: Type Inference and Try Blocks

2020-01-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 20 January 2020 at 23:16:07 UTC, Henry Claesson wrote: This isn't a D-specific "problem", but there may be D-specific solutions. I have a function `doSomething()` that returns a Voldemort type, and this same function also throws. So, there's this: try { auto foo = doSomething();

Type Inference and Try Blocks

2020-01-20 Thread Henry Claesson via Digitalmars-d-learn
This isn't a D-specific "problem", but there may be D-specific solutions. I have a function `doSomething()` that returns a Voldemort type, and this same function also throws. So, there's this: try { auto foo = doSomething(); } catch (AnException e) { // Do stuff } The problem that I'm

Re: dub dustmite struggles

2020-01-20 Thread DanielG via Digitalmars-d-learn
On Monday, 20 January 2020 at 15:04:32 UTC, Andre Pany wrote: In general dub Dustmite works fine, I used it several times. Maybe it has to do s.th. with your project structure. Please create a dub issue with an example zip. I've created a minimal nested project with a similar structure (libra

Defining an alias to an overloaded function

2020-01-20 Thread olvy via Digitalmars-d-learn
I'm learning D, and as an exercise, I'm trying to define a HashSet that would be a wrapper around an associative array with some dummy value type. This worked fine until I've tried writing opSlice for this HashSet in terms of the byKey() function of the AA. I defined my own internal type tha

Re: dub dustmite struggles

2020-01-20 Thread Andre Pany via Digitalmars-d-learn
On Monday, 20 January 2020 at 06:48:08 UTC, DanielG wrote: I can't seem to figure out what dub's dustmite command is looking for with its regexes. No matter what I try - no matter how simple - the initial test fails. I am able to run dustmite standalone just fine with the following test scrip

Re: Specify dmd or ldc compiler and version in a json dub file?

2020-01-20 Thread Andre Pany via Digitalmars-d-learn
On Monday, 20 January 2020 at 11:54:43 UTC, Bastiaan Veelo wrote: On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer wrote: I would like to know how to specify dmd or ldc compiler and version in a json dub file. Update: you can at least specify these in the toolchain requirements sect

Re: Specify dmd or ldc compiler and version in a json dub file?

2020-01-20 Thread Bastiaan Veelo via Digitalmars-d-learn
On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer wrote: I would like to know how to specify dmd or ldc compiler and version in a json dub file. Update: you can at least specify these in the toolchain requirements section: https://dub.pm/package-format-json.html#toolchain-requirement