64,646
社区成员
发帖
与我相关
我的任务
分享
basic_string(size_type _Count, _Elem _Ch)
: _Mybase()
{ // construct from _Count * _Ch
_Tidy();
assign(_Count, _Ch);
}
_Myt& assign(size_type _Count, _Elem _Ch)
{ // assign _Count * _Ch
if (_Count == npos)
_Xlen(); // result too long
if (_Grow(_Count))
{ // make room and assign new stuff
_Chassign(0, _Count, _Ch);
_Eos(_Count);
}
return (*this);
}
static _Elem *__CLRCALL_OR_CDECL assign(_Elem *_First, size_t _Count, _Elem _Ch)
{ // assign _Count * _Ch to [_First, ...)
return ((_Elem *)_CSTD memset(_First, _Ch, _Count));
}