commit | 0e0b520fed3412648edb78fd46f4bd668dca2dea | [log] [tgz] |
---|---|---|
author | K Lubick <kjlubick@google.com> | Mon Apr 01 14:21:42 2024 -0400 |
committer | Kevin Lubick <kjlubick@google.com> | Mon Apr 01 19:42:44 2024 +0000 |
tree | caa33b4cf064785f912b6bfcc193ec74342793d4 | |
parent | e727b91ec444203aa559f16e7f55d8fc9cc53c5a [diff] |
Fix some c++20 warnings In some of our benchmarks, we use volatile to try to make sure the compiler doesn't optimize away certain operations. If there is a better way to do that, I'm open to that. Implicit capturing of this in lambdas has been deprecated due to the potentially confusing behavior. [1] Changing [=] -> [=, this] won't work due to the latter being a c++20 extension. However, for many uses, we can improve the style/readability of the code anyway [2] by making the captures explicit. Finally, there was a warning about non-const operator== being ambiguous, so I fixed those I could find with grep. [1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html [2] https://google.github.io/styleguide/cppguide.html#Lambda_expressions "Prefer explicit captures when the lambda will escape the current scope." Bug: b/311238827 Change-Id: I1725adaa2c258e0fdee2fe398647c15d2cbc9966 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/833811 Reviewed-by: John Stiles <johnstiles@google.com>