Re: Why are enums with base type string not considered strings?

2021-03-16 Thread wolframw via Digitalmars-d-learn
On Sunday, 14 March 2021 at 16:30:47 UTC, Bastiaan Veelo wrote: On Sunday, 14 March 2021 at 16:09:39 UTC, Imperatorn wrote: On Sunday, 14 March 2021 at 10:42:17 UTC, wolframw wrote: [...] May be a regression? https://issues.dlang.org/show_bug.cgi?id=16573 Indeed:

Why are enums with base type string not considered strings?

2021-03-14 Thread wolframw via Digitalmars-d-learn
enum BoolEnum : bool { TestBool = false } enum CharEnum : char { TestChar = 'A' } enum StringEnum : string { TestString = "Hello" } pragma(msg, isBoolean!BoolEnum); // true pragma(msg, isSomeChar!CharEnum); // true pragma(msg, isSomeString!StringEnum); // false Why does

Re: redirect std out to a string?

2020-05-21 Thread wolframw via Digitalmars-d-learn
On Thursday, 21 May 2020 at 15:42:50 UTC, Basile B. wrote: On Thursday, 21 May 2020 at 04:29:30 UTC, Kaitlyn Emmons wrote: is there a way to redirect std out to a string or a buffer without using a temp file? yes: [snip] Alternatively, setvbuf can be used: void[1024] buf; // buffer must

Re: How can I open a Binary EXE with Hexadecimal?

2020-05-02 Thread wolframw via Digitalmars-d-learn
On Saturday, 2 May 2020 at 21:05:32 UTC, Baby Beaker wrote: save as "rb" again. This will not work. To be able to write to a binary file, you will have to use "wb".

Re: date and timestamp

2020-04-29 Thread wolframw via Digitalmars-d-learn
On Wednesday, 29 April 2020 at 22:22:04 UTC, guai wrote: Hi, forum I have two questions: 1) Why __DATE__ and __TIMESTAMP__ have these insane formats? "mmm dd " and "www mmm dd hh:mm:ss " I think its the first time in my life I encounter something like this. start with date, then print

Default initialization of static array faster than void initialization

2019-11-08 Thread wolframw via Digitalmars-d-learn
Hi, Chapter 12.15.2 of the spec explains that void initialization of a static array can be faster than default initialization. This seems logical because the array entries don't need to be set to NaN. However, when I ran some tests for my matrix implementation, it seemed that the