Talk:cpp/string/basic string view/find first not of

I believe that string::find_first_not_of and all its variants (string_view:: instead of string, last instead of first, and of instead of not_of) are now overloaded to accept a string_view as the first parameter. Please add these.

172.88.122.95 13:16, 4 January 2022 (PST)


 * They're already there --Ybab321 (talk) 14:06, 4 January 2022 (PST)

I dont' see the "const std::basic_string &" version on this page. I believe that the C++17 standard lists BOTH that AND the "basic_string_view" versions. Yes, a const string & can be converted to a string_view, but the standard lists explicit overloads for each.

172.88.122.95 16:38, 4 January 2022 (PST)


 * Doesn't look like it --Ybab321 (talk) 17:35, 4 January 2022 (PST)

OK, you are right. My eyes slipped as I was checking the standard. I guess string::find_first_not_of includes a const string & overload for "hysterical raisins" while the string_view version doesn't have that history.

(That also assumes that passing and using a string_view is no more expensive than passing and using a const string &, which is probably true for most implementations.)

172.88.122.95 18:53, 4 January 2022 (PST)