DEV Community

Discussion on: How do you declare a function in C++?

Collapse
 
sandordargo profile image
Sandor Dargo

As a return type, I've only used auto in coding exercises, to burn it in my memory, but not yet in production code.

On the other hand, using auto in variable declarations is pretty cool. First I was shocked a bit by the feeling of losing information, but once I started thinking about the reasons why developers like Herb Sutter or Scott Meyers advocate that we should almost always use auto (in variable declarations) my heart and mind softened a lot.