Hacker Newsnew | past | comments | ask | show | jobs | submit | oreliazz's commentslogin

To get something into C++ someone has to actually write a paper and propose it to the standards committee who has to vote and agree on it.

You can't just have some dude write a span.hpp and go "yep, that's going into my compiler v2" - not how standards work.


I would’ve much rather have gotten span into C++11 than variadic templates, for instance. Definitely seems to me like a paper about span would’ve been a lot shorter and easier to write than one about variadic templates.


That’s a pretty surprising opinion. Variadic templates are extremely widely used and there’s no simple replacement (e.g. how would you implement something like emplace_back without them?) Span is trivial to replace with a third party library.


Very much. In many cases a single variadic replaces tens of thousands of lines of code, often machine generated, greatly simplifying code bases and speeding up compilation. It also immediately obsoleted the whole of boost.mpl. Together with lambda they are probably my favourite feature of c++11.

Span is nice especially as a vocabulary type, but it wasn't hard to implement something functionally similar and in practice most of codebases already did.


Heck I'm still using gsl::span, though that's mainly for compatibility with a C++17 compiler. It's great that std::span was standardized, maybe it was overdue, but it's just a drop-in replacement for stuff that already existed and worked fine.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: