Skip to content

C2923 when compiling template class Vector3 (Name conflicts with macros) #24

@EasternJournalist

Description

@EasternJournalist

I was compiling with C++17 MSVC. And it went : 'Float' is not a valid template type argument for parameter 'Float'. And a lot of compiling errors followed.

The errors occurr here (and also the same in the function "max").

template <typename Float>
inline Vector3<Float> min(const Vector3<Float>& a, const Vector3<Float>& b) noexcept
{
   ...
}

I suppose it's because min and max are defined macro in its included files. After changing the name of the funtions to "Min" and "Max", it passes successfully. It can also be solved by undefining min and max at the head of the file.

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