Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::allocator<T>: use of 'construct' and 'destroy' deprecated since C++17 #532

Open
mkrausex opened this issue Feb 21, 2023 · 5 comments
Open

Comments

@mkrausex
Copy link
Contributor

mkrausex commented Feb 21, 2023

Vigra currently does not compile with Visual Studio 2019 in C++20 mode because of the use of the deprecated functions mentioned in the issue title (which have been removed in C++20).

I would suggest to replace that with the corresponding functionality from std::allocator_traits (as in the attached patch), however that has only been available since C++11, and I don't know whether Vigra is still required to work with pre-C++11 compilers?

@mkrausex mkrausex changed the title std::allocator<T>: use of 'construct' and 'destroy' is deprecated std::allocator<T>: use of 'construct' and 'destroy' deprecated since C++17 Feb 21, 2023
@hmaarrfk
Copy link
Collaborator

If we merge #514 would you be able to add a job for C++20 compatibility given our infrastructure?

@hmaarrfk
Copy link
Collaborator

your patch also seems trivial to wrap in ifdefs to have compatibility C++ before 11.

@mkrausex
Copy link
Contributor Author

[...] would you be able to add a job for C++20 compatibility given our infrastructure?

I am not sure what exactly this involves -- extend azure-pipelines.yml, and that's it? Is VS2019 usable as a compiler there?

So far, I haven't even used the CMake-based build system of Vigra (my project has been using the Vigra header files directly). I've just tried to compile the full unit-test suite here on my computer using CMake for the first time. I enabled C++20 by adding set(CMAKE_CXX_STANDARD 20) to the main CMakeLists.txt, and used Visual Studio 2022. Beyond the issues I reported today, a couple of other errors pop up there (seems like my own project hasn't been including all of Vigra ...), which we would need to fix as well for a successful CI run (but that seems doable).

@mkrausex
Copy link
Contributor Author

your patch also seems trivial to wrap in ifdefs to have compatibility C++ before 11.

The question is whether this is necessary: you have #511 on your revival checklist, which (because it uses a lambda) would already make C++11 the minimum required C++ standard for Vigra. (On the other hand, the lambda is only used in a .cxx, not in the header-only core implementation of Vigra...)

@hmaarrfk
Copy link
Collaborator

hmaarrfk commented Oct 1, 2023

If you make a PR I think it is fine to merge and drop compatibility for before C++11, users can pin to version 1.11.1.

Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants