Re: Is this a bug?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
On Thursday, 16 March 2023 at 04:31:11 UTC, Elfstone wrote: On Thursday, 16 March 2023 at 04:04:51 UTC, Elfstone wrote: On Thursday, 16 March 2023 at 03:44:19 UTC, Elfstone wrote: [...] Correction. With or without comments, mostly it doesn't compile, occasionally it does! I have no idea.

Re: Is this a bug?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
On Thursday, 16 March 2023 at 04:04:51 UTC, Elfstone wrote: On Thursday, 16 March 2023 at 03:44:19 UTC, Elfstone wrote: On Thursday, 16 March 2023 at 03:40:04 UTC, Elfstone wrote: [...] Oops, the above code compiles, because I added comments!!! Now this really doesn't compile: ```D struct M

Re: Is this a bug?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
On Thursday, 16 March 2023 at 03:44:19 UTC, Elfstone wrote: On Thursday, 16 March 2023 at 03:40:04 UTC, Elfstone wrote: [...] Oops, the above code compiles, because I added comments!!! Now this really doesn't compile: ```D struct Matrix(S, size_t M, size_t N) { } alias Vec3(S) = Matrix!(S,

Is this a bug?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
```D struct Matrix(S, size_t M, size_t N) { } alias Vec3(S) = Matrix!(S, 3, 1); void main() { import std.stdio; writeln(is(Vec3!float == Matrix!(S, 3, 1), S)); // `alias` `S` is defined here writeln(is(Matrix!(float, 3, 1) == Matrix!(S, 3, 1), S)); // Error: declaration `S` is alr

Re: Is this a bug?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
On Thursday, 16 March 2023 at 03:40:04 UTC, Elfstone wrote: ```D struct Matrix(S, size_t M, size_t N) { } alias Vec3(S) = Matrix!(S, 3, 1); void main() { import std.stdio; writeln(is(Vec3!float == Matrix!(S, 3, 1), S)); // `alias` `S` is defined here writeln(is(Matrix!(float, 3, 1

Re: Better way to compromise on the lack of template alias resolution stuff?

2023-03-15 Thread Elfstone via Digitalmars-d-learn
On Wednesday, 15 March 2023 at 19:22:32 UTC, Paul Backus wrote: On Tuesday, 14 March 2023 at 10:19:24 UTC, Elfstone wrote: [...] Currently the best workaround for this is to define `Vector` as a `struct` with `alias this` instead of as an `alias`: ```d struct Matrix(S, size_t M, size_t N) {

Re: My tiny program still can't get FreeImage.dll to load... GLFW.dll library loads no problem...

2023-03-15 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
I replicated it, copied the Dist folder from the zip beside app.json, set the right file to load and it worked. http://downloads.sourceforge.net/freeimage/FreeImage3180Win32Win64.zip ``` $ dub run Starting Performing "debug" build using C:\Tools\D\ldc2-1.31.0-windows-multilib\bin\ldc2.exe

Re: My tiny program still can't get FreeImage.dll to load... GLFW.dll library loads no problem...

2023-03-15 Thread Hipreme via Digitalmars-d-learn
On Wednesday, 15 March 2023 at 22:09:35 UTC, WhatMeWorry wrote: I appreciate all the help people have given me previously. So I've made everything super simple. The dub.sdl file consists of four lines: - Solution to this problem: Checking whether it exists is completely irrelevant if you do

My tiny program still can't get FreeImage.dll to load... GLFW.dll library loads no problem...

2023-03-15 Thread WhatMeWorry via Digitalmars-d-learn
I appreciate all the help people have given me previously. So I've made everything super simple. The dub.sdl file consists of four lines: name "00_03_freeimage_debug" dependency "bindbc-glfw" version="~>1.0.0" dependency "bindbc-freeimage" version="~>1.0.2" versions "FI_318" The app.d use ex

Re: #define-like behavior

2023-03-15 Thread bomat via Digitalmars-d-learn
On Wednesday, 15 March 2023 at 19:27:19 UTC, Paul Backus wrote: It's shorthand for defining an unnamed `enum` with a single member: ... Ah, I see. Thanks!

Re: #define-like behavior

2023-03-15 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 15 March 2023 at 16:40:52 UTC, bomat wrote: Just out of curiosity: Can you explain to me why this is called an `enum` although it's clearly not an enumeration? Seems like a random abuse of a keyword... It's shorthand for defining an unnamed `enum` with a single member: ```d e

Re: Better way to compromise on the lack of template alias resolution stuff?

2023-03-15 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 14 March 2023 at 10:19:24 UTC, Elfstone wrote: I went back to some of my old code and couldn't stand what I had ended up with - If I already have a well-defined `Vector`, why do I have to write extra code to implement `isVector`, and use `isVector` instead of simply declaring the pa

Re: #define-like behavior

2023-03-15 Thread bomat via Digitalmars-d-learn
Just out of curiosity: Can you explain to me why this is called an `enum` although it's clearly not an enumeration? Seems like a random abuse of a keyword...