Why does string::find return size_type and not an iterator?
- by dehmann
In C++, why does string::find return size_type and not an iterator?
It would make sense because functions like string::replace or string::insert take iterators as input, so you could find some character and immediately pass the returned iterator to replace, etc.
Also, std::find returns an iterator -- why is std::string::find different?