AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
MathUtils.h: Investigate replace/remove Clamp() function in favour of C++17 std::clamp()
Open
Modernise (C++17)
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 503
- PR merge metrics
- No merged PRs in 30d
Description
As we are now C++17 or greater we should probably investigate replacing calls to Clamp() with std::clamp.
Care may need with both performance and behaviour of non-normals etc to ensure the behaviour remains unchanged - for example ordering of arguments when one of them is a Nan, handling of +0.0 vs -0.0 etc
https://en.cppreference.com/w/cpp/algorithm/clamp.html
At first glance our implementation appears to be directly substitutable.
Contributor guide
Assessment
This issue has not been assessed yet.