Tuples and multiple return values in C

Jaakko Järvi · 1999

A generic tuple class, capable of storing an arbitrary number of elements each being of arbitrary type, is presented. The class oers a concise means to return multiple values from a function. Instead of using refrerence parameters to pass data out of functions, the function return type is an instantiation of the tuple template, grouping the values to be returned. The semantics of the tuple class is analogous to the pair template in the C++ standard library, thus the usage of tuples is convenient and intuitive. The implementation is described in details.

Read the paper · More papers on PaperTik