Exercise 10a. tuple_cat.

In this exercise, you'll implement std::tuple_cat (almost) from scratch. I first saw the high-level "get-of-get" strategy in this implementation coming from Stephan T. Lavavej. Thanks to Michael Park for pointing out that the same get-of-get strategy suffices to compute ResultType as well.

Exercise 10a. Implement tuple_cat

Open this wandbox (b, b, b, b). You'll see an almost-complete implementation of my::tuple_cat.

1. Fill in the bodies of the functions in "index-of-tuple.h" and "index-into-tuple.h" so that the test cases in those files pass.

You might want to copy each of the two ".h" files into a new wandbox, temporarily, so you don't have to see irrelevant compiler errors from tuple_cat and main while you work.

2. Run the test cases in main(). Do they pass?


You're done with this exercise! Sit back and relax, or optionally, browse the following blog posts.