Skip to content

MathUtils.h: Investigate replace/remove Clamp() function in favour of C++17 std::clamp() #2255

@KevinJW

Description

@KevinJW

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions