DMD 0.177 release
Sean Kelly
sean at f4.ca
Mon Dec 11 10:50:41 PST 2006
Brad Roberts wrote:
>
> Since the desired behavior is construction, let's stop kidding ourselves
> and actually give structs both the behavior and the syntax of
> construction, please? And while you're in there.. how about destruction
> and RAII?
What ever happened to structs as aggregates? I thought this was their
entire purpose for being in D. Adding ctors makes sense because it
merely simplifies initialization, but adding dtors, copy semantics, and
opAssign all seem bent on making structs into something they're not.
After all, isn't that why we have classes? In fact, many of the
instances where I was inclined to use structs simply to avoid the GC
evaporated when stack construction of classes was added a few releases
ago. Aside from the addition of a ctor, I'm quite happy to leave
structs exactly as they were before 177. That said, I suppose I can
appreciate the desire to give classes opAssign (even though it's
somewhat weird), and perhaps the operator was added to structs simply
for the sake of consistency.
Sean
More information about the Digitalmars-d-announce
mailing list