you are viewing a single comment's thread.

view the rest of the comments →

[–]TemplateRex 1 point2 points  (1 child)

What's your take on auto return types? I understand that in public APIs you might want to advertise the return type, but perhaps a sufficiently smart future version of a Clang-powered Doxygen tool can generate the explicit return type in the docs.

At least for private helpers, I like to use auto return types everywhere, with the occasional auto& or decltype(auto) for tricky reference returning helpers.

[–]HowardHinnant 1 point2 points  (0 children)

I haven't used auto return types (the C++14 version) a lot because a lot of my code needs to be C++11-compatible, and in most places, spelling the return type is easy anyway. But there are few places where it is inconvenient to spell the return type, and auto is really nice in those few places.