Hacker News new | past | comments | ask | show | jobs | submit login

<random> and <chrono> have really been in a death match of "C++ standard libraries that are super-annoyingly C++", but they've both been absolutely destroyed by <range>, i think.



I agree regarding <random>, but <chrono> is a work of art.


I don't know man, if I have to do another std::chrono::duration_cast, i might chuck my computer out of a window.


We’re so far off topic, but I agree with you SO much. <chrono> completely resists my attempts to remember how to do anything with it, no matter how many times I have needed to do something trivial like “time this region of code.”


This cppunk design aims to provide building blocks for you to build your own solution instead of some ready solution out of fear that they might misdesign something, that's why it's so heavily customizable. So yeah, you're supposed to roll a layer on top of it and build a component with reasonable functionality for this day or for your case.


I like <chrono>. But I recently used the not quite yet standard "date" library. And that is super confusing in combination with <chrono>. You end up having an overlap of some functions and classes, some of which are in the date namespace, some of which are in chrono/std. And functions don't even properly error on compile when you do things wrong, but quietly misbehave. I hope this will solve itself once both arrive in compilers and both are in std:: namespace.


As in range being better or even worse? I haven't tried it out yet.


From what little I've used it, <range> is a C++ nightmare. Compile times explode and every time you get a tiny type error (which is impossible avoid, because the library is very persnickety about types) you get a bazillion pages of template errors.

Concepts and modules (supposedly) fix these issues, and I'm not going to use ranges again until those two are very mature features of C++. Even if you ignore this stuff, it's incredibly "C++ified" in just the worst way, with incredibly obtuse templates and type concepts all over the place.




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

Search: