C++ Logo

std-proposals

Advanced search

Re: String contains member function

From: Mingxin Wang <mingxwa_at_[hidden]>
Date: Fri, 31 May 2019 15:31:25 +0000
Another difference, except for theoretical implementation complexity, could be: “set::contains” provides single-element lookup mechanism while the semantics for the proposed “string::contains” is related to a continuous segment of multiple elements with a specific order.

On the other hand, even we could come up with a good name, I think a convincing motivation usually has more priority than concrete design. Therefore, more investigation about motivation around the previous comments may be necessary.

________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]>
Sent: Friday, May 31, 2019 10:56 PM
To: std-proposals_at_[hidden]
Cc: Giuseppe D'Angelo
Subject: Re: [std-proposals] String contains member function

On 31/05/2019 14:31, Ville Voutilainen via Std-Proposals wrote:
> Well, {map,set}::contains is a logarithmic operation, string::contains
> would be linear. That could well be an argument for naming the linear
> operation differently from the logarithmic one.

What about std::unordered_map::contains then?

My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kdab.com&amp;data=02%7C01%7Cmingxwa%40microsoft.com%7Cd23285333e474ece064d08d6e5d82090%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636949113756019585&amp;sdata=hHKyQnM2Cv2zu4E4Wq0MEtexUBc85JY9Jf2OD3erMV4%3D&amp;reserved=0
KDAB - The Qt, C++ and OpenGL Experts

Received on 2019-05-31 10:33:14