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

std::clamp ; I got it exactly wrong and would have introduced a bug if the compiled didn't tell me I was discarding the return value. I thought it updated the value I wanted clamped. It does not. Don't know why I thought that, but I did.

The function is entirely useless and pointless to call without using the returned value, and [[nodiscard]] pointed this out to me. Perfect.




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

Search: