Can we just have struct inheritence already?

XavierAP n3minis-git at yahoo.es
Wed Jun 19 07:51:59 UTC 2019


On Tuesday, 18 June 2019 at 18:08:31 UTC, Olivier FAURE wrote:
>
> It's not just bool, it's also enums at the very least.
> [...]
> It doesn't really matter, the problem still occurs if you do an 
> explicit cast.

I understand, I meant that there is an additional difference of 
intent when using a bool or enum, or an integer explicitly. 
Declaring variables as bool or enums, even though these types are 
under the hood implemented as integers, makes the code appear 
more type-safe than declaring them as int (even if still using or 
casting them as bool or enum). But the type-safety of bool and 
enums is actually broken. My meaning was, do you need these fancy 
sugar types if you are writing =void C/asm-like code, hadn't you 
better use int only in these cases?

Anyway in general, void initialization is already not @safe in 
case of pointers, classes or interfaces. Perhaps it has to be 
moved out of @safe completely. It's not as drastic as eliminating 
it completely.


More information about the Digitalmars-d mailing list