5 ms·
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-
by PaulDavisThe1st 1y ago
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.
- kstrauser 1y agoFair 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!
- PaulDavisThe1st 1y agoAnything that might accept either (0 or 1 of something) or (0 to N of something).