https://github.com/taocpp/tuple
Compile-time-efficient proof-of-concept implementation for std::tuple
https://github.com/taocpp/tuple
Last synced: 3 months ago
JSON representation
Compile-time-efficient proof-of-concept implementation for std::tuple
- Host: GitHub
- URL: https://github.com/taocpp/tuple
- Owner: taocpp
- License: mit
- Created: 2015-10-19T18:58:17.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-12-21T16:12:33.000Z (6 months ago)
- Last Synced: 2025-12-23T05:59:17.401Z (6 months ago)
- Language: C++
- Homepage:
- Size: 841 KB
- Stars: 94
- Watchers: 8
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# The Art of C++ / Tuple
[](https://github.com/taocpp/tuple/releases/latest)
[](https://conan.io/center/recipes/taocpp-tuple)
[The Art of C++](https://taocpp.github.io/) / Tuple is a C++11 header-only proof-of-concept implementation of
[`std::tuple`](http://en.cppreference.com/w/cpp/utility/tuple).
## Rationale
Why another implementation of `std::tuple`? To provide a proof-of-concept that,
when avoiding recursion, code can benefit in significant ways. I prepared a talk
about it, including some benchmarks.
[Download presentation](https://github.com/taocpp/tuple/blob/main/doc/variadic_templates.pdf)
TL;DR: GCC 5 on Linux with libstdc++'s `std::tuple` requires 19.6s and an instantiation
depth of at least 3.719 to compile an
[example](https://github.com/taocpp/tuple/blob/main/src/test/tuple/tuple_benchmark.cpp)
generating a tuple with 265 elements via `std::tuple_cat`.
`tao::tuple` requires 1.2s and an instantiation depth of 26 on the same system.
Apple LLVM 7.0 (~Clang 3.7) with libc++'s `std::tuple` requires 70s and an instantiation
depth of 514 to compile the example. `tao::tuple` requires 1.7s and an instantiation depth
of 15 on the same system. This case does *not* change `std::integer_sequence` or
`std::make_integer_sequence`, all improvements are coming from all the *other* improvements
from avoiding recursion.
## CUDA
`tao::tuple` supports [CUDA](http://www.nvidia.com/object/cuda_home.html).
## Compatibility
* Requires C++11 or newer.
* Tested with GCC 4.8+, Clang 3.4+, and Visual Studio 2017.
## Package Managers
You can download and install [The Art of C++](https://taocpp.github.io/) / Tuple using the [Conan](https://github.com/conan-io/conan) package manager:
conan install -r conancenter --requires="taocpp-tuple/1.0.0"
The taocpp-tuple package in conan is kept up to date by Conan team members and community contributors.
If the version is out-of-date, please [create an issue or pull request](https://github.com/conan-io/conan-center-index) on the Conan Center Index repository.
## Changelog
### 1.0.0
Released 2018-08-01
* Initial release.
## License
The Art of C++ is certified [Open Source](http://www.opensource.org/docs/definition.html) software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html) reproduced here.
See the [LICENSE](LICENSE) file for details.