Re: static assert("nothing")

2022-05-31 Thread Tejas via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting errors because I forgot the first "false" or "0" paramet

Re: static assert("nothing")

2022-05-31 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 09:52:10 UTC, realhet wrote: On Tuesday, 31 May 2022 at 09:35:30 UTC, Andrea Fontana wrote: On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Check if that string is init. assert("", "cool"); assert("ehh", "cool"); assert(string.init, "Not cool"); I feel some

Re: static assert("nothing")

2022-05-31 Thread realhet via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 09:35:30 UTC, Andrea Fontana wrote: On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Check if that string is init. assert("", "cool"); assert("ehh", "cool"); assert(string.init, "Not cool"); I feel some "JavaScript equality operator" vibes in this :D Anyways,

Re: static assert("nothing")

2022-05-31 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting errors because I forgot the first "false" or "0" paramet

Re: static assert("nothing")

2022-05-31 Thread bauss via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 09:11:41 UTC, JG wrote: On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting erro

Re: static assert("nothing")

2022-05-31 Thread JG via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting errors because I forgot the first "false" or "0" paramet

Re: static assert("nothing")

2022-05-31 Thread bauss via Digitalmars-d-learn
On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote: Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting errors because I forgot the first "false" or "0" paramet

static assert("nothing")

2022-05-31 Thread realhet via Digitalmars-d-learn
Hi, In my framework I just found a dozen of compile time error handling like: ...else static assert("Invalid type"); This compiles without error. And it was useless for detecting errors because I forgot the first "false" or "0" parameter. I think it is because of the weird case of "every s