dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


advertisement
 

C++0x Automates Type Deduction with auto

Tired of typing unwieldy type names in variable declarations? Why not let the compiler do that dirty job, automatically deducing the type from the variable's initializer?


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


nother C++0x feature is going to simplify the way you write C++ code. Instead of tediously writing the type of a variable when you declare it, a C++0x compiler will deduce the variable's type automatically simply by looking at its initializer—if you ask it to. The following sections will demonstrate how to use this feature.


Declaring the type of certain variables (for example, iterators) leads to code clutter and maintenance difficulties.


Use the revamped auto keyword to let the compiler automatically deduce a variable's type from its initializer.





Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date