3 ms·
You put it in library code so the callers don't have to see it. I am always amused when a new C++ standard issues how many people complain "why did they add th
by gumby 2y ago
You put it in library code so the callers don't have to see it.
I am always amused when a new C++ standard issues how many people complain "why did they add this obscure stuff and not my favourite feature?". Many of those changes are for library writers and don't have a lot of applicability for use in "normal" code. But everybody gets the benefit when the standard library speeds up or handles a non-obvious corner case.
- wakawaka28 2y agoI'm glad I could amuse you but your smugness is unwarranted. I am well aware that this is aimed at library writers but everyone probably should be getting warnings for this crap anyway. Tell me when you can opt me into the warning some other way besides polluting the code with more Byzantine compiler-specific annotations. Are there really so many false positives and legitimate uses of this behavior that you have to opt in on a function by function basis? I could accept that possibility but inquiring minds want to know that there isn't a better way to do this that truly maximizes the benefit of the new feature. I don't want to create more work for myself reading or writing annotations because there are already so many things to think about. The only time I could see myself using this annotation is if the code is so complex (possibly due to crap like this) that I can't tell if this one specific error can happen and I somehow remember this obscure feature that day.