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 @@ -390,18 +390,12 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
390
390
template <class _InputIterator , class _Sentinel >
391
391
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
392
392
__init_with_sentinel (_InputIterator __first, _Sentinel __last) {
393
- #if _LIBCPP_HAS_EXCEPTIONS
394
- try {
395
- #endif // _LIBCPP_HAS_EXCEPTIONS
396
- for (; __first != __last; ++__first)
397
- push_back (*__first);
398
- #if _LIBCPP_HAS_EXCEPTIONS
399
- } catch (...) {
400
- if (__begin_ != nullptr )
401
- __storage_traits::deallocate (__alloc_, __begin_, __cap_);
402
- throw ;
403
- }
404
- #endif // _LIBCPP_HAS_EXCEPTIONS
393
+ auto __guard = std::__make_exception_guard (__destroy_vector (*this ));
394
+
395
+ for (; __first != __last; ++__first)
396
+ push_back (*__first);
397
+
398
+ __guard.__complete ();
405
399
}
406
400
407
401
template <class _Iterator , class _Sentinel >
You can’t perform that action at this time.
0 commit comments