From Jason Turner
Watch on YouTube

Summary

This episode explains the differences between std::invoke and std::apply, two powerful standard library utilities for calling functions. Jason demonstrates how std::invoke allows calling any callable (functions, member functions, lambdas) with individual arguments, while std::apply is designed to work with tuple-like objects by unpacking their elements as arguments. The episode also explores a simplified implementation of std::apply using template metaprogramming, showing how it utilizes index sequences to extract elements from tuples at compile time.

Resources

Tags