2018Unpublished venueRequires access

Tuples in C++ and their Applications

Daniel Duffy

Open publisher page 0 citations

Abstract

In a programming language, a tuple is a data object containing other objects as elements or members. These elements may be of different types. This chapter gives a mathematical introduction to the concept of a tuple (or n-tuple) which is an ordered set of n elements or components of heterogeneous type where n is a non-negative integer. It then describes the main language features of std::tuple and reviews the functionality in std::pair (which is a 2-tuple) and by giving examples of the new features in C++11. The chapter also gives a discussion on how to avoid possible run-time performance bottlenecks when using std::tuple in the wrong way. It then discusses two libraries that offer similar functionality to std::tuple: Boost Tuple; and Boost Fusion. Furthermore, the chapter investigates the consequences of using tuples as return types of, and as input arguments to, functions. Finally, it summarizes the advantages and applications of tuples.

About this research paper

What this paper is about

In a programming language, a tuple is a data object containing other objects as elements or members. These elements may be of different types. This chapter gives a mathematical introduction to the concept of a tuple (or n-tuple) which is an ordered set of n elements or components of heterogeneous type where n is a non-negative integer. It then describes the main language features of std::tuple and reviews the functionality in std::pair (which is a 2-tuple) and by giving examples of the new features in C++11. The chapter also gives a discussion on how to avoid possible run-time performance bottlenecks when using std::tuple in the wrong way. It then discusses two libraries that offer similar functionality to std::tuple: Boost Tuple; and Boost Fusion. Furthermore, the chapter investigates the consequences of using tuples as return types of, and as input arguments to, functions. Finally, it summarizes the advantages and applications of tuples.

Why it matters

A significance statement is not available in the OpenAlex record.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

In a programming language, a tuple is a data object containing other objects as elements or members. These elements may be of different types. This chapter gives a mathematical introduction to the concept of a tuple (or n-tuple) which is an ordered set of n elements or components of heterogeneous type where n is a non-negative integer. It then describes the main language features of std::tuple and reviews the functionality in std::pair (which is a 2-tuple) and by giving examples of the new features in C++11. The chapter also gives a discussion on how to avoid possible run-time performance bottlenecks when using std::tuple in the wrong way. It then discusses two libraries that offer similar functionality to std::tuple: Boost Tuple; and Boost Fusion. Furthermore, the chapter investigates the consequences of using tuples as return types of, and as input arguments to, functions. Finally, it summarizes the advantages and applications of tuples.

Key concepts: Tuple, Tuple space, Computer science, Object (grammar), Set (abstract data type), Integer (computer science), Theoretical computer science, Programming language

Related papers

Back to paper searchBrowse research topicsOriginal source
Tuples in C++ and their Applications — Research Paper | ScholarLens