On Wednesday, 15 March 2023 at 19:27:19 UTC, Paul Backus wrote:
It's shorthand for defining an unnamed `enum` with a single
member: ...
Ah, I see. Thanks!
On Wednesday, 15 March 2023 at 16:40:52 UTC, bomat wrote:
Just out of curiosity:
Can you explain to me why this is called an `enum` although
it's clearly not an enumeration?
Seems like a random abuse of a keyword...
It's shorthand for defining an unnamed `enum` with a single
member:
```d
e
Just out of curiosity:
Can you explain to me why this is called an `enum` although it's
clearly not an enumeration?
Seems like a random abuse of a keyword...
On Tuesday, 14 March 2023 at 06:20:29 UTC, Mike Parker wrote:
On Tuesday, 14 March 2023 at 05:47:35 UTC, Jeremy wrote:
[...]
Manifest constants in D have a similar effect as #defined
values, e.g.:
[...]
Thanks a lot!
h its value, like
#define in C, or will it make a string in memory and refer to
that?
In D, you can get #define-like behavior by declaring the string
as a [manifest constant][1], like this:
```d
enum myString = "hello";
```
For more tips on how to translate C preprocessor idioms to
On Tuesday, 14 March 2023 at 05:47:35 UTC, Jeremy wrote:
Hi, in C and C++ you can use #define to substitute a value in
place of an identifier while preprocessing. If you initialize a
new string and don't change its value after that, will the
compiler substitute the string identifier with its va
Hi, in C and C++ you can use #define to substitute a value in
place of an identifier while preprocessing. If you initialize a
new string and don't change its value after that, will the
compiler substitute the string identifier with its value, like
#define in C, or will it make a string in memor