C has a lot of problems but it also has designated initializers, so it's impossible to say if it's bad or not,

I realise the only way C can have this feature in the first place is because of it's odd initialization semantics (particularly zero initialization, which only works by virtue of not having constructors (and thus having all types be trivially constructable)

Rust probably couldn't do this. C++ couldn't do it for the longest time, and it only got reintroduced in heavily nerfed form


@saphie (Found this quite late, but...) I was gonna ask "can't const_fns do this in Rust?", but now that I think about it... I guess array initialization wouldn't count as a const_fn...

· · Web · 0 · 0 · 0
Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!