nianticlabs/spz

constexpr function 'spz::times' cannot result in a constant expression

Opened this issue · 3 comments

The 'times' overload constexpr Quat4f times(const Quat4f &a, const Quat4f &b) results in the following error on windows:

constexpr function 'spz::times' cannot result in a constant expression

This function appears to be unused, so removing it resolved this issue but this may be the reason why this error is not occurring on other platforms.

Meakk commented

I do have a warning on Linux. Another fix could be to change constexpr to inline.

This was an error for me on linux w/ gcc 9.4. Changing constexpr to inline made the error go away for me as well.

I believe the root cause of this is that Quat4f normalized(const Quat4f& v); is not a constexpr function.

Met the same issue on Windows w/ VS2022. Changing the constexpr to inline would resolve the issue.