TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24859 19
C++26: Span improvements and freestanding.

Given the freestanding remarks at https://www.sandordargo.com/blog/2026/03/18/cpp26-span-improvements blog post.

> As freestanding environments generally cannot support exceptions, parts of these facilities cannot be included. Specifically, span::at() (since it throws std::outofrange) and all overloads of std::expected::value() are excluded from the freestanding subset.

It appears that once again, even with C++26 hardening runtime, there were some security improvements that were left out of the table when targeting freestanding environments.

Like possibly having some try_at() that would return std::optional or std::expected result types.

At least looking at the proposed std::span I am not able to find such alternatives.

https://redd.it/1rwznpr
@r_cpp
Sandor Dargo’s Blog C++26: Span improvements A while back, we talked about how using std::span instead of C-style arrays makes your code safer and easier to reason about. std::span, added in C++20, is a non-owning view over a contiguous sequence of objects - think of it as a string_view, but for arrays.…
More from @r_cpp
  1. Oct 7, 2026New to c++ Hello everybody,im new to cpp,and want to learn it,i have some knowledge with C…
  2. Oct 7, 2026Optimizing the Compressed Log Pipeline: https://github.com/Tencent/BqLog/blob/main/docs/Ar…
  3. Oct 7, 2026BqLog 2.6.0: a C++ logging library running on 30M+ devices daily, benchmarked against quil…
  4. Oct 7, 2026BqLog 2.6.0: a C++ logging library running on 30M+ devices daily, benchmarked against quil…
  5. Oct 7, 2026LearnCPP taking 2.5 Go of RAM It's crazy that with the number of adds on the website, lear…
  6. Oct 7, 2026A faster way to convert a timestamp ➜ Hour, Min, Sec https://www.benjoffe.com/fast-time-of…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →