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

Cereal and C++20 #638

Open
2 of 3 tasks
lukaszgemborowski opened this issue Apr 22, 2020 · 2 comments
Open
2 of 3 tasks

Cereal and C++20 #638

lukaszgemborowski opened this issue Apr 22, 2020 · 2 comments

Comments

@lukaszgemborowski
Copy link
Contributor

lukaszgemborowski commented Apr 22, 2020

I'm trying to use cereal library in my C++20 pet project (using current gcc 10 snapshot). As far as the library is considered there's only one issue (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html), implicit 'this' capture in two lambdas in cereal.hpp which results in a warning. Quite easy to fix. But there are two more "complicated" issues within tests:

  1. basic_string.cpp - as far as I understand the error is in doctest has_insertion_operator trait. The root cause of this is: operator<<(basic_ostream<char, _Traits>&, wchar_t) = delete; (yes, this is explicitly deleted in C++20 stdlib). Assuming we aim at C++11 and onwards we can replace the check with slightly modified version of answer from SO: https://stackoverflow.com/a/22759544 - at least it won't fail to compile with C++2a enabled. The question is if we want to modify it in place or rather target to fix it upstream?

  2. performance.cpp - this one I don't have idea how to approach. The problem is in boost library, basically boost::format won't compile with C++20 because it use two argument Allocator::allocate somewhere deep. This was removed in C++20.

Any thoughts?

Things to fix

@lukaszgemborowski
Copy link
Contributor Author

doctest fix is now merged into the dev branch. In parallel I was trying to use boost::format() from the latest boost develop branch and it seem to compile well with -std=c++20 switch on gcc 10. I'll try to setup a fresh environment to compile cereal with latest versions of boost and doctest and see if everything's fine, potentially closing this issue.

@patlecat
Copy link

Why not use the fmt lib instead of boost format? It's going to be in C++20 anyways.

@AzothAmmo
Copy link
Contributor

AzothAmmo commented Jun 16, 2020 via email

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

3 participants