Click here to Skip to main content
14,327,298 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: my turn for a vs rant Pin
Mark_Wallace24-Apr-19 11:09
memberMark_Wallace24-Apr-19 11:09 
GeneralRe: my turn for a vs rant Pin
Rick York23-Apr-19 12:35
mveRick York23-Apr-19 12:35 
GeneralModern C++ auto Pin
steveb23-Apr-19 5:23
membersteveb23-Apr-19 5:23 
GeneralRe: Modern C++ auto Pin
Rick York23-Apr-19 5:34
mveRick York23-Apr-19 5:34 
GeneralRe: Modern C++ auto Pin
#realJSOP23-Apr-19 7:58
mve#realJSOP23-Apr-19 7:58 
GeneralRe: Modern C++ auto Pin
Member 916705724-Apr-19 0:34
memberMember 916705724-Apr-19 0:34 
GeneralRe: Modern C++ auto Pin
ceduardodfernandes24-Apr-19 2:15
memberceduardodfernandes24-Apr-19 2:15 
GeneralRe: Modern C++ auto Pin
Member 916705724-Apr-19 2:18
memberMember 916705724-Apr-19 2:18 
That's pretty much the point. In most cases, namely when the type doesn't matter as long as it works, the developer doesn't need to know. In edge cases, such as auto i=1 where i is required to be, let's say, an unsigned value somewhere later down the line, the developer can still forego the auto and make it a unsigned int i=1 or at least an auto i=static_cast<unsigned int>1.

An example from my own work: I've been using API functions like GetTickCount quite a lot and instead of looking up the exact return type, a simple auto s=GetTickCount does the job. API functions returning some value are documented as "Returns 0 if the operation succeeded", in that case, a if 0==s is still enough, I don't need to know the type.
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 6:32
memberRick Shaub24-Apr-19 6:32 
GeneralRe: Modern C++ auto Pin
OriginalGriff23-Apr-19 5:57
protectorOriginalGriff23-Apr-19 5:57 
GeneralRe: Modern C++ auto Pin
GuyThiebaut23-Apr-19 6:39
professionalGuyThiebaut23-Apr-19 6:39 
GeneralRe: Modern C++ auto Pin
Theraot24-Apr-19 1:35
memberTheraot24-Apr-19 1:35 
GeneralRe: Modern C++ auto Pin
dandy7225-Apr-19 9:42
memberdandy7225-Apr-19 9:42 
GeneralRe: Modern C++ auto Pin
GuyThiebaut23-Apr-19 6:44
professionalGuyThiebaut23-Apr-19 6:44 
GeneralRe: Modern C++ auto Pin
Maximilien23-Apr-19 7:14
memberMaximilien23-Apr-19 7:14 
GeneralRe: Modern C++ auto Pin
David O'Neil23-Apr-19 11:19
professionalDavid O'Neil23-Apr-19 11:19 
GeneralRe: Modern C++ auto Pin
Dean Roddey23-Apr-19 7:58
memberDean Roddey23-Apr-19 7:58 
GeneralRe: Modern C++ auto Pin
Dean Roddey23-Apr-19 15:50
memberDean Roddey23-Apr-19 15:50 
GeneralRe: Modern C++ auto Pin
Rage23-Apr-19 20:46
professionalRage23-Apr-19 20:46 
GeneralRe: Modern C++ auto Pin
Andy Hoffmeyer24-Apr-19 4:14
memberAndy Hoffmeyer24-Apr-19 4:14 
GeneralRe: Modern C++ auto Pin
wheelman570z24-Apr-19 7:11
professionalwheelman570z24-Apr-19 7:11 
GeneralRe: Modern C++ auto Pin
Andy Hoffmeyer24-Apr-19 7:41
memberAndy Hoffmeyer24-Apr-19 7:41 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 7:55
memberDean Roddey24-Apr-19 7:55 
GeneralRe: Modern C++ auto Pin
Rick Shaub24-Apr-19 9:33
memberRick Shaub24-Apr-19 9:33 
GeneralRe: Modern C++ auto Pin
Dean Roddey24-Apr-19 10:00
memberDean Roddey24-Apr-19 10:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.