Default struct constructor

psycha0s box at mail.com
Fri Feb 8 19:53:16 UTC 2019


> In my particular case I need RAII initializing a C library 
> object. Some of the C constructor functions don't have 
> arguments. So the only way to do it is my silly hack with Dummy 
> object. I would probably vote for a change in D spec.

I see. Yeah, I remember I encountered with the need to have a 
default struct constructor myself earlier, but I couldn't 
remember the reason. Some of the current D "features" are very 
inconvenient. Especially the inability to pass an rvalue by a 
const reference and the forbidden default constructors for 
structs.


More information about the Digitalmars-d mailing list