Skip to content

warning C4127: conditional expression is constant #28

@HookedBehemoth

Description

@HookedBehemoth

Compiling this with MSVC 16 on C++20 and tweening a glm::vec3 I get the following warning:

[build] [...]\lib\tweeny\include\easingresolve.h(44,35): warning C4127: conditional expression is constant [[...]\build\opengl-tests.vcxproj]
[build] [...]\lib\tweeny\include\easingresolve.h(43,1): message : consider using 'if constexpr' statement instead [[...]\build\opengl-tests.vcxproj]
[build] [...]\lib\tweeny\include\easingresolve.h(43): message : while compiling class template member function 'void tweeny::detail::easingresolve<1,TypeTuple,FunctionTuple>::impl(FunctionTuple &)' [[...]\build\opengl-tests.vcxproj]
[build]           with
[build]           [
[build]               TypeTuple=std::array<glm::vec<3,float,glm::packed_highp>,1>,
[build]               FunctionTuple=std::tuple<std::function<glm::vec3 (float,glm::vec3,glm::vec3)>>
[build]           ]
...

Adding the constexpr removes the warning but you should know more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions