-
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
P0843 inplace_vector (draft) #4848
Conversation
@microsoft-github-policy-service agree |
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.
Thank you!
I think I can answer these questions.
Once MSVC STL start to accept PR for C++26 features, <yvals_core.h>
and corresponding feature test macro test file should also be updated.
#if _STL_COMPILER_PREPROCESSOR | ||
#include <xmemory> | ||
|
||
#include <memory> // TODO: Required for uninitialized range ops without allocator parameter |
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.
If we don't want constexpr
to be blocked, perhaps we should add _Uglified constexpr
versions of these standard algorithms in <xmemory>
and add // TRANSITION, P2283
comments. This will allow us to include <xmemory>
only.
But I think the used algorithms should be moved to <xmemory>
eventually.
stl/inc/inplace_vector
Outdated
_NODISCARD constexpr bool operator==(const _Inplace_vector_const_iterator& _Right) const noexcept { | ||
return _Ptr == _Right._Ptr; | ||
} |
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.
This is probably buggy, see #4847. How about changing iterator types to _Inplace_vector_iterator::_Iterator<_IsConst>
and provide comparison operators as hidden friends?
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.
inplace_vector<expected<any, char>, 1> cont{};
(void) (cont.begin() == cont.end());
This works. Is that good enough?
f0fb34d
to
00c2aba
Compare
00c2aba
to
6be994d
Compare
I appreciate the enthusiasm, but in #4766 we clearly explained:
It's going to be a while before we can accept C++26 PRs. I think it'll be distracting and unproductive (as merge conflicts accumulate) to keep a PR open for what's likely to be more than a year, so I'm going to go ahead and close this. You're welcome to resubmit a PR when we begin work on C++26. |
<inplace_vector>
according to P0843vector
unit test with some changes.uninitialized_*
functions from<memory>
.The
_Uninitialized_*
from<xmemory>
require an allocator parameter which we don't have here.Should we
TODO
comments in the code for open questions:<memory>
functions usage._Inplace_vector_nontrivial_dummy_type
is a duplicate of_Nontrivial_dummy_type
in<optional>
._Inplace_vector_value_init_tag
is a duplicate of_Value_init_tag
in<vector>
.vector::pop_back
checks for_ITERATOR_DEBUG_LEVEL
and not_CONTAINER_DEBUG_LEVEL
. I followed suit, but is that intended?I'm aware that you're prioritising C++23 features for now. This PR will just be waiting in the meantime.