-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Restrict conversion to SmallVector #42694
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
Conversation
The old implementation allowed calling SmallVector constructor and operator= for any type without restrictions, but then failed with a compiler error when the type wasn't a collection. Instead, we should only use it if Container follows a container concept and just not match the constructor otherwise. This fixes an issue @kimishpatel was running into. Differential Revision: [D22983020](https://our.internmc.facebook.com/intern/diff/D22983020/) [ghstack-poisoned]
The old implementation allowed calling SmallVector constructor and operator= for any type without restrictions, but then failed with a compiler error when the type wasn't a collection. Instead, we should only use it if Container follows a container concept and just not match the constructor otherwise. This fixes an issue @kimishpatel was running into. Differential Revision: [D22983020](https://our.internmc.facebook.com/intern/diff/D22983020/) ghstack-source-id: 109370513 Pull Request resolved: #42694
💊 CI failures summary and remediationsAs of commit cc41a65 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
| } | ||
|
|
||
| template <typename Container> | ||
| // note: The enable_if restricts Container to types that have a .begin() and .end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this locally. It works.
kimishpatel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix Sebastian.
|
This pull request has been merged in 95f4f67. |
Stack from ghstack:
The old implementation allowed calling SmallVector constructor and operator= for any type without restrictions,
but then failed with a compiler error when the type wasn't a collection.
Instead, we should only use it if Container follows a container concept and just not match the constructor otherwise.
This fixes an issue @kimishpatel was running into.
Differential Revision: D22983020