Skip to content

Using auto instead of container::const_iterator #3195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

Inujel
Copy link
Contributor

@Inujel Inujel commented Dec 29, 2020

Fixes #3194

@google-cla
Copy link

google-cla bot commented Dec 29, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Dec 29, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@Inujel
Copy link
Contributor Author

Inujel commented Dec 29, 2020

@googlebot I fixed it.

@google-cla
Copy link

google-cla bot commented Dec 29, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Dec 29, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

Comment on lines 290 to 291
// Implemented as an explicit loop since std::count_if() in libCstd on
// Solaris has a non-standard signature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, would this workaround (a hand-written "count-if", below here) still be necessary, or is std::count_if nowadays fine on any supported platform? The workaround was introduced by zhanyong.wan, April 12, 2011 "Fixes Sun C++ compiler errors (by Pasi Valminen)", b8c0e16

@@ -4597,7 +4594,7 @@ UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,

// Create a matcher for each element in rhs_container.
::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> > matchers;
for (typename RhsStlContainer::const_iterator it = rhs_stl_container.begin();
for (auto it = rhs_stl_container.begin();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a range-based for loop be OK here as well? (Just asking. I'm not a maintainer.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so!

@andrewkcorcoran
Copy link

Any progress getting this approved/merged? As stated by the linked issues this is preventing gtest from being used with gsl::span.

@ladislas
Copy link

would need this as well! :)

@Ket3r
Copy link

Ket3r commented Jul 30, 2021

Any news on when this will be merged?

@samkearney
Copy link

Ran across this issue today, +1 for merging this!

derekmauro added a commit that referenced this pull request Sep 23, 2021
PiperOrigin-RevId: 398271948
dinord added a commit that referenced this pull request Sep 23, 2021
PiperOrigin-RevId: 398271948
@dinord dinord merged commit e4717df into google:master Sep 23, 2021
geissonator pushed a commit to openbmc/openbmc-build-scripts that referenced this pull request Apr 13, 2022
The std::span does not support some gtest MACROS and is fixed in
google/googletest#3195 and
google/googletest@e4717df

Including the fixes to support std::span in gtests.

Match the openembedded gtest version in
openembedded/meta-openembedded#564

Change-Id: Ia0171160ee7a0a36c2fb27eb441e25cdec9ba9f1
Signed-off-by: Willy Tu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ElementsAre doesn't compile if container::const_iterator is not declared
8 participants