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

Add static for some _Xxxx() member functions #3755

Merged
merged 5 commits into from
Jun 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
for array
achabense authored Jun 8, 2023
commit 02a9af5a600f44d163e4c3e900f4511fccb11e70
16 changes: 9 additions & 7 deletions stl/inc/array
Original file line number Diff line number Diff line change
@@ -570,11 +570,12 @@ public:
return _Elems;
}

[[noreturn]] void _Xran() const {
_Ty _Elems[_Size];

private:
[[noreturn]] static void _Xran() {
_Xout_of_range("invalid array<T, N> subscript");
}

_Ty _Elems[_Size];
};

#if _HAS_CXX17
@@ -758,13 +759,14 @@ public:
return nullptr;
}

[[noreturn]] void _Xran() const {
_Xout_of_range("invalid array<T, 0> subscript");
}

conditional_t<disjunction_v<is_default_constructible<_Ty>, _Is_implicitly_default_constructible<_Ty>>, _Ty,
_Empty_array_element>
_Elems[1];

private:
[[noreturn]] static void _Xran() {
_Xout_of_range("invalid array<T, 0> subscript");
}
};

_EXPORT_STD template <class _Ty, size_t _Size, enable_if_t<_Size == 0 || _Is_swappable<_Ty>::value, int> = 0>