Tuple types and multiple return values
C/C++ Users Journal
C++ Function Object Binders Made Easy
GCSE '99 Proceedings of the First International Symposium on Generative and Component-Based Software Engineering
A Java framework for the static reflection, composition and synthesis of software components
PPPJ '03 Proceedings of the 2nd international conference on Principles and practice of programming in Java
Non-strict execution in parallel and distributed computing
International Journal of Parallel Programming
Template constructors for reusable object initialization
Proceedings of the 12th international conference on Generative programming: concepts & experiences
Hi-index | 0.00 |
A generic tuple class, capable of storing an arbitrary number of elements each being of arbitrary type, is presented. The class offers 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. Efficiency considerations are addressed. It is shown that with modern C++ compilers, there is no extra runtime overhead caused by using tuples. However, due to excessive template instantiatons, there is some effect on compilation times and memory usage during compilation. This effect is unlikely to be significant in real programs.