In C I can do the following:
void apply(struct Appearance a) {...}
// usage
apply((struct Appearance) {
.color = BLACK,
.strokeWidth = 4
});
Can I do the same in D without creating a struct variable separately?
void apply(Appearance a) {...}
// currently accepts
Appearance a = { color: BLACK, strokeWidth: 4 };
apply(a);
// would like this
apply({ color: BLACK, strokeWidth: 4 });
// or this
apply(Appearance(color: BLACK, strokeWidth: 4)); // other fields are default initialized: strokeOpacity, fillOpacity, etc...