Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: ui/gfx/geometry/point_f.h

Issue 1464603003: Use std::tie() for operator< in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/geometry/point.h ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/point_f.h
diff --git a/ui/gfx/geometry/point_f.h b/ui/gfx/geometry/point_f.h
index d3a99f149c9f4547149da0822eddb60e7a5694f7..8fcb98a923265f6949e579e480499ea75a158758 100644
--- a/ui/gfx/geometry/point_f.h
+++ b/ui/gfx/geometry/point_f.h
@@ -7,6 +7,7 @@
#include <iosfwd>
#include <string>
+#include <tuple>
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/vector2d_f.h"
@@ -63,7 +64,7 @@ class GFX_EXPORT PointF {
// This comparison is required to use PointF in sets, or sorted
// vectors.
bool operator<(const PointF& rhs) const {
- return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_);
+ return std::tie(y_, x_) < std::tie(rhs.y_, rhs.x_);
}
void Scale(float scale) {
« no previous file with comments | « ui/gfx/geometry/point.h ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698