-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement P1425 iterator range constructors for stack and queue #1994
Implement P1425 iterator range constructors for stack and queue #1994
Conversation
Addresses microsoft#1965
Addresses microsoft#1965
This comment has been minimized.
This comment has been minimized.
b3116f8
to
ccdf327
Compare
Is it intended not to apply LWG-3506 to C++14/17 modes? |
That is a good point. The maintainers can give direction |
stl/inc/queue
Outdated
template <class _InIt, class _Alloc, enable_if_t<uses_allocator_v<_Container, _Alloc>, int> = 0> | ||
priority_queue(_InIt _First, _InIt _Last, const _Pr& _Pred, const _Container& _Cont, const _Alloc& _Al) |
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.
According to LWG-3522, all of these priority_queue
constructors taking _InIt
should be additionally constrained by _Is_iterator
, so I think we need to conjunction_v
all 4 of them.
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.
I went with simple && as I believe we do not really need the short circuiting of conjunction and might avoid some type instantiations
139a594
to
a9e8c3d
Compare
This comment has been minimized.
This comment has been minimized.
…eduction Guides" This reverts commit 55cea37.
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.
Looks good, thanks! I'll validate and push some changes.
I'm mirroring this to an MSVC-internal PR. It's totally fine to push changes for code review feedback, but please notify me in that case. |
using namespace std; | ||
|
||
constexpr int some_data[] = {0, 1, 2, 3, 4, 5}; | ||
constexpr int additional_data[] = {6, 7, 8, 9, 10, 11}; |
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.
These variable names are truly inspired. (No change requested.)
Thanks for implementing this C++23 feature and related LWG issue resolutions! 😻 ✔️ 🚀 |
This implements P1425.
While we are at it it also implements LWG-3506 and LWG-3522. (There is nothing to do for LWG-3529 - it's already implemented.)
Addresses #1965
Fixes #1973