-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add Python-like set operations to flat_set #2557
Conversation
AntoinePrv
commented
May 31, 2023
- Add flat-set doctest printer
- Add Python-like set operations to flat_set
747a297
to
26a4fe7
Compare
I feel like it's not a good idea to wrap generic algorithms into member functions for convenience because
I'm not completely against adding these functions but could you make them free instead of member at least? |
26a4fe7
to
6bcdc04
Compare
The algorithms exists as member functions because they can leverage the specific internals of the class for better algorithmic complexity. Just like we don't use IMHO C++ |
@@ -30,6 +30,7 @@ namespace mamba::util | |||
public: | |||
|
|||
using Base = std::vector<Key, Allocator>; | |||
using Self = flat_set<Key, Compare, Allocator>; |
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.
nitpicking: I think we can simply use flat_set
in the declaration and implementation, the template parameters will be deduced.
template <class InputIt1, class InputIt2, class Compare> | ||
auto | ||
set_disjoint(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp) | ||
-> bool |
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.
🥲