advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
Rate this item | 0 users have rated this item.
 

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

  Next Page: Presenting the Problem
Page 1: IntroductionPage 3: Pointers and References
Page 2: Presenting the Problem 
Please rate this item (5=best)
 1  2  3  4  5
Please rate this item (5=best)
 1  2  3  4  5
advertisement