Re: enum true, or 1

2021-07-23 Thread Ali Çehreli via Digitalmars-d-learn
On 7/22/21 1:44 PM, Brian Tiffin wrote: > So would there be any cringes Not from me. :) > seeing a skeleton D source file that > always ended with > > ~~~d > /++ > Disclaimer > > This software is distributed in the hope that it will be useful, but > WITHOUT ANY WARRANTY; direct or

Re: enum true, or 1

2021-07-22 Thread Brian Tiffin via Digitalmars-d-learn
On Thursday, 22 July 2021 at 03:58:38 UTC, Ali Çehreli wrote: On 7/21/21 8:44 PM, Brian Tiffin wrote: > What is the preferred syntax for simple on/off states? I use std.typecons.Flag. It feels very repetitive but that's what we have: import std.typecons; void foo(Flag!"doFilter" doFilter) {

Re: enum true, or 1

2021-07-21 Thread Ali Çehreli via Digitalmars-d-learn
On 7/21/21 8:44 PM, Brian Tiffin wrote: > What is the preferred syntax for simple on/off states? I use std.typecons.Flag. It feels very repetitive but that's what we have: import std.typecons; void foo(Flag!"doFilter" doFilter) { if (doFilter) { // ... } } bool someCondition; void ma

Re: enum true, or 1

2021-07-21 Thread rikki cattermole via Digitalmars-d-learn
On 22/07/2021 3:44 PM, Brian Tiffin wrote: What is the preferred syntax for simple on/off states?  Did I read that D was moving to strictly 1 and 0 literals instead of true/false on/off yes/no? This is the first time I'm hearing about it, so almost certainly no.

Re: enum true, or 1

2021-07-21 Thread Mathias LANG via Digitalmars-d-learn
On Thursday, 22 July 2021 at 03:44:13 UTC, Brian Tiffin wrote: What is the preferred syntax for simple on/off states? Did I read that D was moving to strictly 1 and 0 literals instead of true/false on/off yes/no? If so, is there an idiom for yes/no/maybe -1,0,1 less/equal/greater? Excuse

enum true, or 1

2021-07-21 Thread Brian Tiffin via Digitalmars-d-learn
What is the preferred syntax for simple on/off states? Did I read that D was moving to strictly 1 and 0 literals instead of true/false on/off yes/no? If so, is there an idiom for yes/no/maybe -1,0,1 less/equal/greater? Excuse the noise. For some backfill; getting used to DDoc. Frontmat