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

[C++] C++14 laundry list #28552

Closed
asfimport opened this issue May 17, 2021 · 2 comments
Closed

[C++] C++14 laundry list #28552

asfimport opened this issue May 17, 2021 · 2 comments

Comments

@asfimport
Copy link
Collaborator

asfimport commented May 17, 2021

Improvements to make/be aware of once C++14 is available:

  • Ensure that lambda closure members are moved into where ever possible/appropriate. We have a lot of local variables whose only function is getting copied into a closure, including some demotions to shared_ptr since move only types can't be closed over in c++11
  • visitor pattern can be used more fluidly with template lambdas, for example we could have a utility like
    VisitInts(offset_width, offset_bytes, [&](auto* offsets) { /*mutate offsets*/ })
    to replace a switch statement like
    switch (offset_width) {
    case 8:
      /* mutate offsets<int8_t> */
      break;
    case 16:
      /* mutate offsets<int16_t> */
      break;
    // ...
    }
  • deduced return type with auto:
    template <typename Container>
    auto GetBeginAndEnd(const Container& cont) {
      return std::make_pair(cont.begin(), cont.end());
    }
  • constexpr switch, for use in type traits functions
  • std::enable_if_t
  • std::quoted is available for escaping strings
  • std::make_unique
  • standard [[deprecated]] attribute
  • temporal literals such as ""s, ""ns, ...
  • binary literals with place markers such as 0b1100_1111

Reporter: Ben Kietzman / @bkietz

Related issues:

Note: This issue was originally created as ARROW-12816. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

@asfimport
Copy link
Collaborator Author

Antoine Pitrou / @pitrou:
For the record, I've opened #10414 to test C++17 support.

@asfimport asfimport mentioned this issue Jan 11, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant