From Jason Turner
Watch on YouTube

Summary

This episode explores std::valarray, a largely forgotten part of the C++ Standard Library that was introduced in C++98 and has received minimal updates since. Jason demonstrates how valarray differs from vector by supporting element-wise operations across entire arrays, lazy evaluation of expressions, and built-in functions like min, max, sum, and trigonometric operations. He shows how these features can help compilers automatically vectorize operations using SIMD instructions for better performance.

Resources

Tags