4 ms·
To me, the C++ version seems entirely unreadable, though. Especially the cdecl inheritance of & going in the wrong place. In some instances Rust has removed sy
by lucian1900 13y ago
To me, the C++ version seems entirely unreadable, though. Especially the cdecl inheritance of & going in the wrong place.
In some instances Rust has removed syntax or its prevalence (@ turned into Gc/Rc; ~[] no longer grows, but Vec does).
To each their own.
- nly 13y agoThe & being on the wrong place is a matter of style. I wrote it that way because it seems to be the popular convention. I'd usually write this myself: draw_all (vector<unique_ptr<Drawable>> const& shapes) { Now the const and ref at together.
- pcwalton 13y agoI think lucian1900 was referring to & going on the right (`vector &foo`) instead of on the left (`&vector<foo>`).
- nly 13y agoI don't see why either is right or wrong, but 'foo' is the reference and vector is the type. It seems logical to me the C++ way, but I'm not overly fussed.
- lucian1900 13y agoDifferent parts of the type are in different places, merely for the space saving of being able to replace "var" or "let" with the type, like "int". While it made sense when C was created, this is horribly wrong this many years later.