From Jason Turner
Watch on YouTube

Summary

This episode explores C++26's new std::views::concat feature, which allows multiple ranges to be treated as a single concatenated range. Jason demonstrates how to combine different container types like arrays, vectors, and lists using this view, explaining that the resulting view preserves the properties of the underlying containers' iterators. When concatenating ranges with different iterator capabilities (like random access vs bidirectional), the resulting view will only support the least powerful iterator category. The assembly code analysis shows the runtime implementation efficiently handles indexing across multiple concatenated containers.

Resources

Tags