Hacker News new | past | comments | ask | show | jobs | submit login

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.



I think lucian1900 was referring to & going on the right (`vector &foo`) instead of on the left (`&vector<foo>`).


I 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.


Different 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: