kasra farsoudi

home portfolio journal

C++20 std::span

2026/10/19


I think std::spans is the most amazing thing to come out of C++20. I am really loving this whole migration of an object as a view / borrowing of data. It is so profound to me how the most basic datastructures in the standard library are accessing the heap by default, and so frequently. Every single line of code I write in C++, I feel as if I have to choose between good looking "std" standard code and actually performant pragmatic code. I love C++, but every project I make makes me understand more and more why Linus Torvalds hates the language. Anyways, std spans, they're great. You're telling me I have a std-friendly way to just pass in a contiguous portion of memory as one argument, and I can even pass their .data() to syscalls? This is beautiful. This is the best invention since sliced bread. If std span has 1 fan on this earth, it's me. If it has 0 fans, I am dead.

c++

← back

kasra farsoudi 2026