On Wednesday, 2 May 2012 at 03:38:41 UTC, Adam D. Ruppe wrote:
On Wednesday, 2 May 2012 at 03:22:02 UTC, Andrei Alexandrescu
wrote:
One feature to remove stands out - the struct initialization:
S s = { 1, 2 };
I could live without that one, because D has an alternative:
auto s = S(1, 2);
And I'd be sad if you took that out, as I use it a lot,
especially
for trivial types:
struct Html { string src; }
struct Text { string src; }
struct Point { int x; int y; }
struct Size { int width; int height; }
which I like because then we can use the types for overloading,
static checks, etc., and it is very very simple to drop in and
use.
I guess there could be opCalls or constructors, but poo, it
works now without that and I like it.
S(...) does not exhibit the same problem as {...} exactly because
it has constructors and static opCall. If you change the order of
fields in S, you can write a constructor preserving the old
behaviour.