@@ -2696,7 +2696,9 @@ private:
2696
2696
enum class _Construct_strategy : uint8_t { _From_char, _From_ptr, _From_string };
2697
2697
template <_Construct_strategy _Strat, class _Char_or_ptr>
2698
2698
_CONSTEXPR20 void _Construct(const _Char_or_ptr _Arg, _CRT_GUARDOVERFLOW const size_type _Count) {
2699
- // Pre: *this is in SSO mode; the lifetime of the SSO elements has already begun
2699
+ auto& _My_data = _Mypair._Myval2;
2700
+ _STL_INTERNAL_CHECK(!_My_data._Large_string_engaged());
2701
+ _STL_INTERNAL_CHECK(_STD count(_My_data._Bx._Buf, _My_data._Bx._Buf + _BUF_SIZE, _Elem()) == _BUF_SIZE);
2700
2702
2701
2703
if constexpr (_Strat == _Construct_strategy::_From_char) {
2702
2704
_STL_INTERNAL_STATIC_ASSERT(is_same_v<_Char_or_ptr, _Elem>);
@@ -2708,7 +2710,6 @@ private:
2708
2710
_Xlen_string(); // result too long
2709
2711
}
2710
2712
2711
- auto& _My_data = _Mypair._Myval2;
2712
2713
auto& _Al = _Getal();
2713
2714
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Al);
2714
2715
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _My_data);
@@ -2718,10 +2719,8 @@ private:
2718
2719
_My_data._Myres = _BUF_SIZE - 1;
2719
2720
if constexpr (_Strat == _Construct_strategy::_From_char) {
2720
2721
_Traits::assign(_My_data._Bx._Buf, _Count, _Arg);
2721
- _Traits::assign(_My_data._Bx._Buf[_Count], _Elem());
2722
2722
} else if constexpr (_Strat == _Construct_strategy::_From_ptr) {
2723
2723
_Traits::move(_My_data._Bx._Buf, _Arg, _Count);
2724
- _Traits::assign(_My_data._Bx._Buf[_Count], _Elem());
2725
2724
} else { // _Strat == _Construct_strategy::_From_string
2726
2725
#ifdef _INSERT_STRING_ANNOTATION
2727
2726
_Traits::move(_My_data._Bx._Buf, _Arg, _Count);
0 commit comments