beltoforion/muparser

C++ 20 standard support.

Closed this issue · 10 comments

Hello!
Is there any chance to add support for C++ 20 standard?

Do you have any indication that it does not compile on a C++20 compliant compiler? What part of the code is not C++20 compliant?

We're using the conan2 package from: https://conan.io/center/recipes/muparser
We've just upgraded our conan profile to cpp 20 and now the build of the package is failing.

image

I cannot find anything suspicious in the line referenced in the error message and i can compile Version 2.3.4 with Visual Studio.

Which version are you using? (of VS)

VS2022; I opened the folder and build it with CMake; The compiler used was MSCV Version 1942

Ok, thanks for the information. Might be a problem with the Conan package, then. Are you the one who maintains it?

No I'm not the maintainer. Is there an easy way to reproduce the issue? I'm unfamiliar with Conan.

If I download your latest realese's source code and I change the CMake from
set(CMAKE_CXX_STANDARD 11)
to
set(CMAKE_CXX_STANDARD 20)

and then I run

  1. cmake -G "Visual Studio 16 2019" -A x64 -B build/
  2. cmake --build build/ --config RelWithDebInfo --parallel --verbose -- /p:CL_MPcount=%NUMBER_OF_PROCESSORS%

I get:

image

Thats something i can work with. This has nothing to do with C++20. For some reason min and max are defined as macros. If you put #undef min and #undef max at the top of the file it should build. I will look for a more elegant solution than that today evening.

As far as i can tell the issue should be fixed. I will prepare a new service release 2.3.5 soon.