New issue
Advanced search Search tips

Issue 624854 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Consider adding ContainsBla for Collections of move-only types in base/

Project Member Reported by mcasas@chromium.org, Jun 30 2016

Issue description

base/stl_util.h has ContainsKey() and ContainsValue() [1]
helper functions to find a Key or a Value in a Container,
respectively. With ScopedVector being deprecated, snippets
of the form

std::vector<std::unique_ptr<Typename>> haystack;

std::find_if(haystack.begin(),
             haystack.end(),
             [needle](const std::unique_ptr<Typename>& entry) {
               return entry.get() == needle;
             });

can be found in the code. 

Consider extending/specialising ContainsValue() or adding 
a ContainsPointedValue() and using it throughout.

[1] https://cs.chromium.org/chromium/src/base/stl_util.h?sq=package:chromium&dr=CSs&l=196

 

Comment 1 by mcasas@chromium.org, Jun 30 2016

Query [1] finds a few,interspersed with other irrelevant results.



[1] https://cs.chromium.org/search/?q=std::find_if+%5C(const+std::unique_ptr&sq=package:chromium&type=cs
Labels: Te-NeedsFurtherTriage
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 3 2017

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment