Date: Fri, 1 Sep 2023 17:03:34 +0000
I didn’t understand what you meant, do you mean to overload the function by the lastest parameter?
But I think this is impossible, because when calling dependent on default argument, it is impossible to distinguish overloading, or remove the default argument of new overloads, will cause users to have to make calls such as s.find("ii", decltype(s)::const_iterator{}), which increases the difficulty of use.
Using a new name is a more reliable solution.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of connor horman via Std-Proposals <std-proposals_at_[hidden]>
Sent: Saturday, September 2, 2023 0:33
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: connor horman <chorman64_at_[hidden]>
Subject: Re: [std-proposals] Iterators for basic_string and basic_string_view find functions
Adding to the colour's for the bikeshed: find_begin(P)/rfind_begin(P) (which returns a reverse_iterator).
Can probably even be overloaded to take both an index and an iterator as the starting position.
On Fri, Sep 1, 2023 at 11:19 Yexuan Xiao via Std-Proposals <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>> wrote:
I disagree with your statement, C++23 added std::ranges::contains_subrange and std::string::contains at the same time, and they do not conflict.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]<mailto:std-proposals-bounces_at_[hidden]>> on behalf of Jason McKesson via Std-Proposals <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>>
Sent: Friday, September 1, 2023 23:06
To: std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]> <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>>
Cc: Jason McKesson <jmckesson_at_[hidden]<mailto:jmckesson_at_[hidden]>>
Subject: Re: [std-proposals] Iterators for basic_string and basic_string_view find functions
On Fri, Sep 1, 2023 at 10:04 AM Yexuan Xiao <bizwen_at_[hidden]<mailto:bizwen_at_[hidden]>> wrote:
>
> std::string requires work with string literals, therefore the member function `size_type find(const CharT* s, size_type pos = 0) const;` is a commonly used version, while std::ranges::find cannot directly achieve the same functionality.
Then your feature suggestion should be restricted to exactly and
*only* those interfaces.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]<mailto:Std-Proposals_at_[hidden]>
https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fstd-proposals&data=05%7C01%7C%7C559decf997ea493c5bce08dbaafd131d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638291776156014197%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=iiJRoz5Gmm%2F%2FKhEuDb8yQlt5xmFHteOdFwZbDc%2FAA%2F4%3D&reserved=0<https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals>
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]<mailto:Std-Proposals_at_[hidden]>
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
But I think this is impossible, because when calling dependent on default argument, it is impossible to distinguish overloading, or remove the default argument of new overloads, will cause users to have to make calls such as s.find("ii", decltype(s)::const_iterator{}), which increases the difficulty of use.
Using a new name is a more reliable solution.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of connor horman via Std-Proposals <std-proposals_at_[hidden]>
Sent: Saturday, September 2, 2023 0:33
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: connor horman <chorman64_at_[hidden]>
Subject: Re: [std-proposals] Iterators for basic_string and basic_string_view find functions
Adding to the colour's for the bikeshed: find_begin(P)/rfind_begin(P) (which returns a reverse_iterator).
Can probably even be overloaded to take both an index and an iterator as the starting position.
On Fri, Sep 1, 2023 at 11:19 Yexuan Xiao via Std-Proposals <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>> wrote:
I disagree with your statement, C++23 added std::ranges::contains_subrange and std::string::contains at the same time, and they do not conflict.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]<mailto:std-proposals-bounces_at_[hidden]>> on behalf of Jason McKesson via Std-Proposals <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>>
Sent: Friday, September 1, 2023 23:06
To: std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]> <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>>
Cc: Jason McKesson <jmckesson_at_[hidden]<mailto:jmckesson_at_[hidden]>>
Subject: Re: [std-proposals] Iterators for basic_string and basic_string_view find functions
On Fri, Sep 1, 2023 at 10:04 AM Yexuan Xiao <bizwen_at_[hidden]<mailto:bizwen_at_[hidden]>> wrote:
>
> std::string requires work with string literals, therefore the member function `size_type find(const CharT* s, size_type pos = 0) const;` is a commonly used version, while std::ranges::find cannot directly achieve the same functionality.
Then your feature suggestion should be restricted to exactly and
*only* those interfaces.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]<mailto:Std-Proposals_at_[hidden]>
https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fstd-proposals&data=05%7C01%7C%7C559decf997ea493c5bce08dbaafd131d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638291776156014197%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=iiJRoz5Gmm%2F%2FKhEuDb8yQlt5xmFHteOdFwZbDc%2FAA%2F4%3D&reserved=0<https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals>
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]<mailto:Std-Proposals_at_[hidden]>
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2023-09-01 17:03:40