Title: std::span (C++20) / gsl::span (GSL + C++14) | hacking C++
Open Graph Title: std::span (C++20) / gsl::span (GSL + C++14)
X Title: std::span (C++20) / gsl::span (GSL + C++14)
Description: Spans are 'view' types that provide access to contiguous sequences without owning the underlying memory resources, i.e., they are not responsible for memory management/allocation/cleanup.
Open Graph Description: Spans are 'view' types that provide access to contiguous sequences without owning the underlying memory resources, i.e., they are not responsible for memory management/allocation/cleanup.
X Description: Spans are 'view' types that provide access to contiguous sequences without owning the underlying memory resources, i.e., they are not responsible for memory management/allocation/cleanup.
Opengraph URL: https://hackingcpp.com/cpp/std/span.html
X: @hackingcpp
Domain: hackingcpp.com
| None | 86400 |
| keyword | cpp view non-owning pointer size |
| author | André Müller |
| date | 2026-06-08 |
| copyright | 2019-2026 André Müller |
| theme-color | #0070C0 |
| og:image | https://hackingcpp.com/cpp/std/span_card.png |
| og:site_name | hacking C++ |
| og:locale | en_US |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://hackingcpp.com/cpp/std/span_card.png |
| twitter:creator | @hackingcpp |
| hcpp-page-category | cat-article |
| hcpp-tags | C++ C++20 STL article containers modern-C++ ranges std-containers std-library views |
Links:
Viewport: width=device-width, initial-scale=1.0