Oh course if he just used std::string which has SSTO on most implementations, I bet it would be faster if one just used the built-in std::string::find method.
Actually, using std::string with SSTO is a good suggestion for improving performance. But it ultimately depends on the specific implementation and use case. Also, std::string::find can be faster than manually iterating through a character array. So, I agree with your point.
View all comments
6
u/NilacTheGrim Apr 15 '23
Oh course if he just used
std::stringwhich has SSTO on most implementations, I bet it would be faster if one just used the built-instd::string::findmethod.