File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -398,18 +398,12 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
398398 template <class _InputIterator , class _Sentinel >
399399 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
400400 __init_with_sentinel (_InputIterator __first, _Sentinel __last) {
401- #if _LIBCPP_HAS_EXCEPTIONS
402- try {
403- #endif // _LIBCPP_HAS_EXCEPTIONS
404- for (; __first != __last; ++__first)
405- push_back (*__first);
406- #if _LIBCPP_HAS_EXCEPTIONS
407- } catch (...) {
408- if (__begin_ != nullptr )
409- __storage_traits::deallocate (__alloc (), __begin_, __cap ());
410- throw ;
411- }
412- #endif // _LIBCPP_HAS_EXCEPTIONS
401+ auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
402+
403+ for (; __first != __last; ++__first)
404+ push_back (*__first);
405+
406+ __guard.__complete ();
413407 }
414408
415409 template <class _Iterator , class _Sentinel >
You can’t perform that action at this time.
0 commit comments