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

Make use of C++20 features #528

Open
4 tasks
eigenraven opened this issue Oct 28, 2021 · 2 comments
Open
4 tasks

Make use of C++20 features #528

eigenraven opened this issue Oct 28, 2021 · 2 comments

Comments

@eigenraven
Copy link
Collaborator

A few useful features:

  • std::span instead of ptr+len pairs and some const vector&/const string& references as it can accept any of these, and avoid copying memory
  • std::jthread stoppable threads - might be good to express threads that must join after they get destructed, especially in testsuites
  • ranges can express many simple algorithms like find-and-remove, etc. more compactly and readably
  • designated initializers for simple structs, this lets them be constructed like {.field1 = 7, .field2 = {.x=1, y=2}} which could be useful for some small structs that get passed around

Refer to https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_features for compiler support, we now use clang-13 with GNU libstdc++11

@Shillaker
Copy link
Collaborator

Shillaker commented Oct 29, 2021

I would also like to investigate using modules to divide along the existing library lines in the CMake project structure. This may improve build performance and tidy up the code, but it could also just add needless verbosity and introduce some compatibility issues with non-Clang compilers.

@Shillaker
Copy link
Collaborator

We can also replace our Latch and Barrier in Faabric using std::latch and std::barrier.

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