Re: 請問STL的string這樣寫有錯誤嗎?
template<class InputIterator, class Type>
InputIterator find(
InputIterator _First,
InputIterator _Last,
const Type& _Val
);
Parameters
_First
An input iterator addressing the position of the first element in the range
to be searched for the specified value.
_Last
An input iterator addressing the position one past the final element in the
range to be searched for the specified value.
_Val
The value to be searched for.
Return Value
An input iterator addressing the first occurrence of the specified value in
the range being searched. If no such value exists in the range, the iterator
returned addresses the last position of the range, one past the final element.
(這個基本上跟.end()的定義相同)
我比較不明白的是, .end()跟string::npos應該不會是一樣的直吧 +_+
不過我似乎也有string::npos當傳回值的印象...?
請問這大概是...?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.163.161.9
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章