std::optional holds zero or one value
std::ranges work with sequences of values
In C++23, they don't talk to each other. You can't pipe an optional into a range pipeline
C++26 makes optional a range
Our mission is to make the C++ programming language accessible and useful to anyone who wishes to learn and apply the language.
Joined November 2017
- std::println("file: {}", path); // error std::println("file: {}", path.string()); // works but wrong quotes std::format works with strings, ints, floats, chrono types, but not filesystem::path C++26 adds the missing formatter
- What encoding is this string in? In C++23, the answer is "whatever the locale says," which might be wrong, and there's no way to ask programmatically C++26 gives you std::text_encoding. Finally a way to name and query encodings at compile time and runtime
- std::to_string(0.1) → "0.100000" That's right – in 2024, C++ was still using sprintf under the hood for to_string. Six trailing zeros and no control over precision C++26 rewrites it to use std::format
- constexpr std::vector? Works. constexpr std::string? Works. constexpr placement new? "Not a constant expression" You could allocate at compile time, but you couldn't construct into that storage C++26 closes the last major gap in constexpr allocation 🧵👇

