Dictionary of Templated Functions

2022-09-09 Thread jwatson-CO-edu via Digitalmars-d-learn
Hello, I'm trying to create a dictionary of templated function pointers. The functions should return `bool` and take a differently-typed dynamics arrays `T[]` as an argument. Based on my understanding of the docs, I've made two failed attempts: **Attempt 1**: https://github.com/PhilippeSig

Re: Validate static asserts

2022-09-09 Thread user1234 via Digitalmars-d-learn
On Friday, 9 September 2022 at 17:35:44 UTC, Dennis wrote: On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov wrote: What's about new `compileOutput` trait that returns compiler output? ```d static assert(__traits(compileOutput, { }) == "message"); ``` As a compiler dev, that sou

Re: Validate static asserts

2022-09-09 Thread Ali Çehreli via Digitalmars-d-learn
On 9/9/22 10:35, Dennis wrote: > On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov wrote: >> What's about new `compileOutput` trait that returns compiler output? >> ```d >> static assert(__traits(compileOutput, { }) == "message"); >> ``` > > As a compiler dev, that sounds terrifying. I

Re: Validate static asserts

2022-09-09 Thread Dennis via Digitalmars-d-learn
On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov wrote: What's about new `compileOutput` trait that returns compiler output? ```d static assert(__traits(compileOutput, { }) == "message"); ``` As a compiler dev, that sounds terrifying. It would make basically every change to dmd

Re: Validate static asserts

2022-09-09 Thread Andrey Zherikov via Digitalmars-d-learn
On Friday, 9 September 2022 at 15:22:30 UTC, Ali Çehreli wrote: I added and removed '&& false' to every 'static assert' condition manually one by one. :/ It's not CI-friendly :( Perhaps a new compiler switch can compile every 'static assert' with an automatic 'false' and dump all their text t

Re: Validate static asserts

2022-09-09 Thread Ali Çehreli via Digitalmars-d-learn
On 9/9/22 07:35, Andrey Zherikov wrote: > might not compile due to many different reasons I faced a related situation recently: My error string generation was buggy, which taught me that the compiler does not even compile the string part of 'static assert' in the 'true' case. The following p

Re: Validate static asserts

2022-09-09 Thread Paul Backus via Digitalmars-d-learn
On Friday, 9 September 2022 at 14:35:33 UTC, Andrey Zherikov wrote: I have bunch of `static assert(, )` in my code and would like to validate that specific code triggers specific assert by checking what `` is thrown. It sounds like maybe your goal here is to test that attempting to compile a

Re: Validate static asserts

2022-09-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/9/22 10:35 AM, Andrey Zherikov wrote: I have bunch of `static assert(, )` in my code and would like to validate that specific code triggers specific assert by checking what `` is thrown. Right now I do `static assert(!__traits(compiles, { }));` but since `` might not compile due to many

Validate static asserts

2022-09-09 Thread Andrey Zherikov via Digitalmars-d-learn
I have bunch of `static assert(, )` in my code and would like to validate that specific code triggers specific assert by checking what `` is thrown. Right now I do `static assert(!__traits(compiles, { }));` but since `` might not compile due to many different reasons, I might not be testing

Poste some interesting vibe.d webpages

2022-09-09 Thread Alain De Vos via Digitalmars-d-learn
I find documentation of vibe.d between worse and bad, while the framework is relative OK. There are a few good links on the internet. I post two of them. Feel free to add other web links in order to increase our knowledge. https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d https:/

Re: OpenXR library bindings etc

2022-09-09 Thread rikki cattermole via Digitalmars-d-learn
Apart from not linking against OpenXR, I'm not seeing anything obviously wrong in that binding.