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

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.




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

Search: