logoalt Hacker News

locknitpickertoday at 10:49 AM2 repliesview on HN

> I understand that people can have many things to say about C++, and I do as well, but `std::span` should have been there decades ago (...)

Decades is kind of a stretch. C++11 introduced smart pointers, and finally getting C++0x out of the door was already a major victory. Given the history of C++, it would be unrealistic to introduce something like std::span before C++17.

Meantime, some organizations are still struggling to migrate to something like C++14.


Replies

pjmlptoday at 11:28 AM

It could have been there since the beginning, given that open arrays (aka spans) already existed in other languages, and there was even a failed proposal from Denis Ritchie regarding C.

The C++ span proposal came from Microsoft,

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p01...

show 1 reply
gignicotoday at 12:49 PM

Afaik std::span does not need anything that was not in C++98 already, or am I missing something?

show 1 reply