From Jason Turner
Watch on YouTube

Summary

This episode explores template-template parameters in C++, which allow functions or classes to accept template types (like std::vector) rather than fully specified types (like std::vector). Jason demonstrates how template-template parameters enable more flexible APIs by letting users specify just the container type while letting the function determine the contained type. He also shows how to combine this with C++20's concepts and requires clauses for Design by Introspection, allowing code to adapt its behavior based on container capabilities.

Resources

Tags