advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Which other programming tasks can tuples simplify? Can you think of complications they might introduce? Tell us about it in our C++ Forum.
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 4.5/5 | Rate this item | 4 users have rated this item.
 

Tackle Common Programming Tasks Using the New <tuple> Library

Tuples are fixed size collections of heterogeneous objects, and they are being added to the C++ standard. Learn how this powerful facility can help you simplify several common programming tasks.  


advertisement
he C++ standards committee is now working on updates and enhancements to the Standard Library. Tuple types are one of the recent additions to the standard. A tuple is a fixed size collection of heterogeneous objects. Tuple types are very powerful and can help you simplify several programming tasks.


How can you simulate multiple return types for a single function? How do you assign and compare multiple values simultaneously?


Use the <tuple> library to define tuple objects and manipulate them.

Author's Note: Thus far, my 10-Minute Solutions have relied solely on C++98 features that every decent compiler should support. However, the <tuple> library isn't included in your IDE's Standard Library yet. Therefore, you will need to download this library from Boost if you wish to compile the code samples included here. Even if you'd rather not install new libraries on your computer, future releases of your compiler will support <tuple> anyway.

  Next Page: Construction and Initialization
Page 1: IntroductionPage 3: Tuples in the Real World
Page 2: Construction and Initialization  
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs