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

Switch to C++17 #1378

Closed
denravonska opened this issue Dec 19, 2018 · 6 comments · Fixed by #2113
Closed

Switch to C++17 #1378

denravonska opened this issue Dec 19, 2018 · 6 comments · Fixed by #2113
Labels
compatibility deprecation Removed deprecated functionality enhancement

Comments

@denravonska
Copy link
Member

This is more of a maybe-next-year kind of thing, but I propose we switch from C++11 to C++14 or even C++17 to be able to utilize new functionality and optimizations. Some things we would directly benefit from are:

string_view (C++17)

Allows you to view a part of a string instead of making a copy. Replaces many usages of substr which speeds up boincblock unpacking and ExtractXML.

  • gcc-7
  • clang-4

std::optional (C++17)

Replaces the need to manually carry an is-initialized flag, see StructCPID.

  • gcc-7
  • clang-4

std::filesystem (C++17)

Replaces boost::filesystem.

  • gcc-8
  • clang-7

Splicing for maps and sets

Cheaper data move between containers.

  • gcc-7
  • clang-8

std::variant (C++17)

Replaces boost::variant.

  • gcc-7
  • clang-4

Relaxing constraints on constexpr functions (C++14)

Allows more flexibility in constexpr functions which gives the compiler a better chance at optimizing.

  • ??

STL constexpr improvements (C++14)

Several functions in the STL have been made constexpr.

  • gcc-5
  • clang-3.4

Parallel algorithms (C++14)

Allows for standard algorithm (find, sort etc) to utilize more cores.

  • Not yet supported in gcc or clang
@jamescowens
Copy link
Member

jamescowens commented Feb 19, 2019

We will not be able to do this until Ubuntu 16.04 is EOL I think. C++14 is covered by GCC5+

@jamescowens jamescowens added compatibility deprecation Removed deprecated functionality labels Jun 6, 2020
@nathanielcwm
Copy link
Contributor

Ubuntu EOL is April 2021 according to: https://wiki.ubuntu.com/Releases

https://gcc.gnu.org/projects/cxx-status.html#cxx17

@jamescowens
Copy link
Member

jamescowens commented Jun 29, 2020

Looks like GCC compiler version 7+ has all of the features. This is in 18.04+. So we have to wait until 16.04 is retired, although there are already some problems compiling on 16.04.

@div72
Copy link
Member

div72 commented Apr 13, 2021

@jamescowens Ubuntu 16.04 is EOL in 2.5 weeks(2021-04-30). Are we clear to bump by then or should we provide a little more time?

@jamescowens
Copy link
Member

We probably should make an announcement about our intentions on Reddit first and hold for a while.

@jamescowens
Copy link
Member

But I do not want to wait too long...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility deprecation Removed deprecated functionality enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants