Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All true but consider writing templates/generic code, where "logger" might be a std::optional or a std::list/vector/whatever. Same syntax, different types. Pre-C++26 you'd need a specialization for std::optional, now you don't.


Fair point, but my imagination’s failing me at the moment. What kind of function would accept something where Optional makes sense and also a list/etc.?

I’m not asking to dispute. I want to be enlightened!


Anything that might accept either (0 or 1 of something) or (0 to N of something).




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

Search: