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

<vector>: Add _CONSTEXPR26 to _Vaporization_guard's destructor once P3068R6 gets implemented #5108

Open
frederick-vs-ja opened this issue Nov 23, 2024 · 0 comments

Comments

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Nov 23, 2024

#4977 added several scope guard types to our implementation of vector, while one of them doesn't have constexpr destructor yet.

STL/stl/inc/vector

Lines 637 to 645 in 5e0ddad

~_Vaporization_guard() noexcept {
if (_Target != nullptr) {
auto& _Al = _Target->_Getal();
auto& _Mylast = _Target->_Mypair._Myval2._Mylast;
_Target->_Orphan_range(_Vaporized_first, _Vaporized_last);
_STD _Destroy_range(_Destroyed_first, _Mylast, _Al);
_Mylast = _Vaporized_first;
}

Lack of constexpr was deliberate - since _Vaporization_guard objects are only created and destroyed during exception handling, which can't happen during exception at this moment.

However, WG21-P3068R6 makes exception handling compatible with constant evaluation, and the paper is recently adopted for C++26. So we need to add _CONSTEXPR26 once P3068 gets implemented (which means that this issue is blocked until that moment).

@frederick-vs-ja frederick-vs-ja changed the title <vector>: Add _CONSTEXPR26 to _Vaporization_guard's destructor once P3068R5 gets implemented <vector>: Add _CONSTEXPR26 to _Vaporization_guard's destructor once P3068R6 gets implemented Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant