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