s2geometry icon indicating copy to clipboard operation
s2geometry copied to clipboard

Port to C++20.

Open gatehouse opened this issue 4 years ago • 7 comments

This patch replaces various constructs that were deprecated in C++17 and removed in C++20 with their C++20 counterparts.

With this patch, s2geometry can be compiled with gcc 10.

gatehouse avatar May 01 '20 11:05 gatehouse

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

googlebot avatar May 01 '20 11:05 googlebot

What's the minimum c++ version needed for this to work?

jmr avatar May 07 '20 19:05 jmr

What's the minimum c++ version needed for this to work? @jmr I would expect this to work from C++14 upwards.

gatehouse avatar May 14 '20 09:05 gatehouse

This isn't compiling:

https://travis-ci.org/github/google/s2geometry/builds/696839883

C++20 is too new to require. C++14 is definitely ok and C++17 is probably ok.

jmr avatar Jun 11 '20 09:06 jmr

With this patch, s2geometry can be compiled with gcc 10.

gcc 10 works without this patch. https://travis-ci.org/github/google/s2geometry/jobs/722137049#L423

jmr avatar Aug 31 '20 07:08 jmr

I will close and re-open this in hope of getting travis-ci to notice the .travis.yml changes. The current CMakeLists.txt is incompatible with the old .travis.yml.

jmr avatar Aug 31 '20 07:08 jmr

This breaks both compilers that support c++20 https://travis-ci.org/github/google/s2geometry/jobs/722649190#L544

and those that don't https://travis-ci.org/github/google/s2geometry/jobs/722649187#L324

jmr avatar Aug 31 '20 07:08 jmr