std:string类的 find_first_not_of函数宣言一堆是什么//basic_string是啥
std::string类的 find_first_not_of函数声明一堆是什么//basic_string是啥?
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(_CharT __c, size_type __pos) const
{
for (; __pos < this->size(); ++__pos)
if (!traits_type::eq(_M_data()[__pos], __c))
return __pos;
return npos;
}
------解决思路----------------------
basic_string 是C++标准库中的字符串模板类。我们一般使用的string其实就是basic_string<char>, wstring是basic_string<wchar>
只要知道string的查找函数都返回string::size_type类型的值就行了
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(_CharT __c, size_type __pos) const
{
for (; __pos < this->size(); ++__pos)
if (!traits_type::eq(_M_data()[__pos], __c))
return __pos;
return npos;
}
------解决思路----------------------
basic_string 是C++标准库中的字符串模板类。我们一般使用的string其实就是basic_string<char>, wstring是basic_string<wchar>
只要知道string的查找函数都返回string::size_type类型的值就行了