Skip to content

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

Description

#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 (tracked by #5136) 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedSomething is preventing work on thisbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions