Re: bindbc OpenGL ES

2020-08-31 Thread Danny Arends via Digitalmars-d-learn
On Monday, 31 August 2020 at 22:25:48 UTC, Mike Parker wrote: On Monday, 31 August 2020 at 14:04:19 UTC, Danny Arends wrote: Don't know exactly where to post this, so I hope the bindbc team will see the post here in learn. I was wondering if it would be possible to have bindbc OpenGL ES bindi

Re: Tuple poilerplate code

2020-08-31 Thread user1234 via Digitalmars-d-learn
On Tuesday, 1 September 2020 at 02:08:54 UTC, JG wrote: Is there anyway to remove the boilerplate code of dealing with tuples: I find myself having to write things like this fairly often auto someRandomName = f(...); //where f returns a tuple with two parts auto firstPart = someRandomName[0

Re: Template argument deduction fails with alias

2020-08-31 Thread Ben Jones via Digitalmars-d-learn
On Tuesday, 1 September 2020 at 01:26:30 UTC, Paul Backus wrote: Aside from using SumType directly in the function signature, another workaround is to use a wrapper struct instead of an alias: struct AliasType(Args...) { SumType!Args data; alias data this; } boo

Tuple poilerplate code

2020-08-31 Thread JG via Digitalmars-d-learn
Is there anyway to remove the boilerplate code of dealing with tuples: I find myself having to write things like this fairly often auto someRandomName = f(...); //where f returns a tuple with two parts auto firstPart = someRandomName[0]; auto secondPart = someRandomName[1]; Is to possible

Re: Template argument deduction fails with alias

2020-08-31 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 1 September 2020 at 01:11:35 UTC, Ben Jones wrote: I have an alias that looks like static if(...){ alias AliasType = SumType!(...); } which I use in a template constraint for a function template: bool func(T: AliasType!Args, Args...)(T t){ ... } When I try to call func with an

How package Dlang in a standalone portable executable?

2020-08-31 Thread Marcone via Digitalmars-d-learn
I need package Dlang in a standalone portable executable. I need packcages all dependencies, dlls, files, etc in one executable file.

Re: Template argument deduction fails with alias

2020-08-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/31/20 9:11 PM, Ben Jones wrote: I have an alias that looks like static if(...){   alias AliasType = SumType!(...); } which I use in a template constraint for a function template: bool func(T: AliasType!Args, Args...)(T t){ ... } When I try to call func with an AliasType object, the arg

Template argument deduction fails with alias

2020-08-31 Thread Ben Jones via Digitalmars-d-learn
I have an alias that looks like static if(...){ alias AliasType = SumType!(...); } which I use in a template constraint for a function template: bool func(T: AliasType!Args, Args...)(T t){ ... } When I try to call func with an AliasType object, the argument deduction fails with a message s

Re: bindbc OpenGL ES

2020-08-31 Thread Mike Parker via Digitalmars-d-learn
On Monday, 31 August 2020 at 14:04:19 UTC, Danny Arends wrote: Don't know exactly where to post this, so I hope the bindbc team will see the post here in learn. I was wondering if it would be possible to have bindbc OpenGL ES bindings ? I can make time for it sometime this week.

The best way to remove an element from DList while iterating over the elements

2020-08-31 Thread Ivan via Digitalmars-d-learn
Hello! I've been trying to implement something like that: struct Element { bool isPendingRelease; } DList!Element elements; void FreePendingElements() { foreach(ref elem; elements) { if (elem.isPendingRelease) { // remove it here from elements }

Re: How to create compile-time container?

2020-08-31 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Aug 31, 2020 at 08:39:10PM +, Andrey Zherikov via Digitalmars-d-learn wrote: > On a low level, I want something like this code to work: > string[] arr; // this can be any suitable type > > arr ~= "a";// data is compile-time constant > > enum f = arr[0]; //

Re: How to create compile-time container?

2020-08-31 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 31 August 2020 at 20:39:10 UTC, Andrey Zherikov wrote: How can I do that? You can use a normal string[] BUT it is only allowed to be modified inside its own function. Then you assign that function to an enum or whatever. string[] ctGenerate() { string[] list; list ~= "stuf

How to create compile-time container?

2020-08-31 Thread Andrey Zherikov via Digitalmars-d-learn
On a low level, I want something like this code to work: string[] arr; // this can be any suitable type arr ~= "a";// data is compile-time constant enum f = arr[0]; // fails with "Error: variable arr cannot be read at compile time" enum b = arr[$-1]; // fails with

Re: Installing D on Fresh Windows 10 machine is a pain

2020-08-31 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 28 August 2020 at 14:36:57 UTC, rikki cattermole wrote: On 28/08/2020 3:59 AM, Jesse Phillips wrote: DMD installer still is unable to find "VS installed" One of the reasons for this is that the environment variables have not been updated. You need to restart to do this. This m

Re: bindbc OpenGL ES

2020-08-31 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 31 August 2020 at 16:56:45 UTC, Danny Arends wrote: On Monday, 31 August 2020 at 15:16:40 UTC, Ferhat Kurtulmuş wrote: On Monday, 31 August 2020 at 14:04:19 UTC, Danny Arends wrote: [...] I have never tried, but this repo may help. I know that it supports d. https://github.com/D

Re: bindbc OpenGL ES

2020-08-31 Thread Danny Arends via Digitalmars-d-learn
On Monday, 31 August 2020 at 15:16:40 UTC, Ferhat Kurtulmuş wrote: On Monday, 31 August 2020 at 14:04:19 UTC, Danny Arends wrote: Don't know exactly where to post this, so I hope the bindbc team will see the post here in learn. I was wondering if it would be possible to have bindbc OpenGL ES

Re: bindbc OpenGL ES

2020-08-31 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 31 August 2020 at 14:04:19 UTC, Danny Arends wrote: Don't know exactly where to post this, so I hope the bindbc team will see the post here in learn. I was wondering if it would be possible to have bindbc OpenGL ES bindings ? I'm working on porting my 3D Engine to Android, and wel

bindbc OpenGL ES

2020-08-31 Thread Danny Arends via Digitalmars-d-learn
Don't know exactly where to post this, so I hope the bindbc team will see the post here in learn. I was wondering if it would be possible to have bindbc OpenGL ES bindings ? I'm working on porting my 3D Engine to Android, and well Android doesn't support anything else but OpenGL ES... I saw

Re: How do I copy struct having immutable pointer member when enabled DIP1000?

2020-08-31 Thread outlandkarasu via Digitalmars-d-learn
On Monday, 31 August 2020 at 05:46:45 UTC, ag0aep6g wrote: `ref` kind of implies `scope` [1]. You don't need to type it out. When you do type out `scope ref const(Price)`, the `scope` actually doesn't apply to the `ref` but to the pointers in `Price` (whereas the `scope` in `scope const(Price)[