From Jason Turner
Watch on YouTube

Summary

This episode demonstrates the refactoring of legacy code in the ChaiScript project from multiple template function overloads to a single variadic template implementation. Jason walks through transforming a set of five nearly identical ExceptionHandler implementations into a unified solution using C++11's variadic templates. He explores two different approaches to variadic template expansion: a recursive template instantiation pattern (which hits some implementation challenges) and a more elegant solution using std::initializer_list to guarantee sequential evaluation order. The episode provides valuable insights into the tradeoffs between different variadic template implementation patterns.

Resources

Tags