I have a project using CMake. The following code builds fine on Apple Clang, MinGW, and Android Cross-Clang but does not build on VS2019:
template<typename Ty> constexpr Ty min(const Ty& _a, const Ty& _b);
Visual Studio produces three errors for the same line:
Error C2988 unrecognizable template declaration/definition
Error C2059 syntax error: 'const'
Error C2059 syntax error: ')'
I feel like it's due to a setting, but Visual Studio is set to use the v142 toolchain and use the latest available C++ standard.