static assert not printing out along the error diagnostic

someone someone at somewhere.com
Wed Jul 14 18:04:44 UTC 2021


On Wednesday, 14 July 2021 at 06:28:37 UTC, jfondren wrote:

> alternate 1:
> - pull tests out into a named enum template, like std.traits
> - always static assert enum, rather than conditionally 
> asserting false
> - always have the rest of the code
>
> ```d
> enum isString(T) = is(T == string) || is(T == wstring) || is(T 
> == dstring);
> // very similar to std.traits.isSomeString
>
> struct gudtUGC(T) {
>     static assert(isString!T, "error message");
>     // unconditional structure code
> }
> ```

... is it me or this isn't triggering the assert either ?


More information about the Digitalmars-d-learn mailing list