Re: How to capture a BitFlags type in a function parameter?

2021-01-31 Thread realhet via Digitalmars-d-learn
On Sunday, 31 January 2021 at 14:16:15 UTC, Paul Backus wrote: On Sunday, 31 January 2021 at 14:04:00 UTC, realhet wrote: Hi, static void stdUI(E, Flag!"unsafe" u)(ref BitFlags!(E, u) flags) {} Thank You! Somehow I forgot I could pass amd match ANY TYPE in the template parameters.

Re: How to capture a BitFlags type in a function parameter?

2021-01-31 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 31 January 2021 at 14:04:00 UTC, realhet wrote: Hi, I wan't to process every specialization of the BitFlags struct in a function: So far the best I can come up is this: static void stdUI(F)(ref F flags) if(F.stringof.startsWith("BitFlags!(")){} But it's obviously lame. If I

How to capture a BitFlags type in a function parameter?

2021-01-31 Thread realhet via Digitalmars-d-learn
Hi, I wan't to process every specialization of the BitFlags struct in a function: So far the best I can come up is this: static void stdUI(F)(ref F flags) if(F.stringof.startsWith("BitFlags!(")){} But it's obviously lame. If I try this way: static void stdUI(E, U)(ref BitFlags!(E, U)