<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/c-26-span-improvements-81hatqzbi" -->

---
title: C++26: Span improvements | daily.dev
description: C++26 introduces four targeted improvements to std::span. First, span<const T> can now be constructed from an initializer list, closing an ergonomic gap...
canonical: https://daily.dev/posts/c-26-span-improvements-81hatqzbi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: C++26: Span improvements | daily.dev
og:description: C++26 introduces four targeted improvements to std::span. First, span<const T> can now be constructed from an initializer list, closing an ergonomic gap...
og:url: https://daily.dev/posts/c-26-span-improvements-81hatqzbi
og:image: https://api.daily.dev/og/posts/81hAtqzbI.png
og:image:alt: C++26: Span improvements
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C++26: Span improvements

**[Sandor Dargo](https://daily.dev/sources/sandordargo)** · 4 min read · 0 upvotes · 0 comments

## Summary

C++26 introduces four targeted improvements to std::span. First, span<const T> can now be constructed from an initializer list, closing an ergonomic gap compared to string_view. Second, span gains a bounds-checked at() member function that throws std::out_of_range, bringing it in line with other standard containers. Third, span, mdspan, expected, out_ptr, and inout_ptr are added to the freestanding subset of the standard library (with at() excluded since it throws). Fourth, CTAD for both span and mdspan becomes integral_constant-aware, allowing the compiler to deduce static extents instead of always falling back to dynamic_extent.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.sandordargo.com/blog/2026/03/18/cpp26-span-improvements>

## Similar posts on daily.dev

- [Chromium’s span-over-initializer-list success story](https://daily.dev/posts/chromium-s-span-over-initializer-list-success-story-zkzr1vben) · Arthur O'Dwyer · 0 upvotes · 0 comments
- [C\+\+26: Standard library hardening](https://daily.dev/posts/c-26-standard-library-hardening-eykurnwet) · Sandor Dargo · 23 upvotes · 1 comments
- [C\+\+26: Reducing undefined behaviour](https://daily.dev/posts/c-26-reducing-undefined-behaviour-tbbsne1hb) · Sandor Dargo · 0 upvotes · 0 comments
- [C Constructs That Still Don’t Work in C\+\+ — and a Few That Changed](https://daily.dev/posts/c-constructs-that-still-don-t-work-in-c-and-a-few-that-changed-0okhcujer) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/c-26-span-improvements-81hatqzbi)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"C++26: Span improvements","url":"https://daily.dev/posts/c-26-span-improvements-81hatqzbi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/c-26-span-improvements-81hatqzbi"},"datePublished":"2026-03-18T07:14:10.909Z","dateModified":"2026-03-18T07:14:28.998Z","description":"C++26 introduces four targeted improvements to std::span. First, span\u003cconst T\u003e can now be constructed from an initializer list, closing an ergonomic gap...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sandor Dargo","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sandor Dargo","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/48d17993e5864d66951193405fa786bb","url":"https://daily.dev/sources/sandordargo"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/c-26-span-improvements-81hatqzbi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c++","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sandor Dargo","item":"https://daily.dev/sources/sandordargo"},{"@type":"ListItem","position":3,"name":"C++26: Span improvements"}]}
```

