3 ms·
The & 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: dra
by nly 13y ago
The & 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.