Implementing a tuple_iterator
This post is part of a collaboration with Arne Mertz.
Arne is a software Engineer at Zühlke and a clean code enthusiast with a focus on modern C++. You can find him online at Twitter and at his “Simplify C++!” blog.
We’ve both written something about accessing std::tuple
,
but swapped our blogs - my post is over at his blog and his one follows here now:
Did you ever wonder how we could iterate over the contents of a std::tuple
at runtime, similar to an array or std::vector
?
You may or may not see the need for such a functionality - this walkthrough shows a proof of concept and how you tackle problems like this in C++17.