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

Side by Side Diff: components/policy/core/common/policy_namespace.cc

Issue 1456263005: Revert of Use std::tie() for operator< in components/ (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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/ids.h ('k') | components/url_matcher/string_pattern.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/policy/core/common/policy_namespace.h" 5 #include "components/policy/core/common/policy_namespace.h"
6 6
7 #include <tuple>
8
9 namespace policy { 7 namespace policy {
10 8
11 PolicyNamespace::PolicyNamespace() {} 9 PolicyNamespace::PolicyNamespace() {}
12 10
13 PolicyNamespace::PolicyNamespace(PolicyDomain domain, 11 PolicyNamespace::PolicyNamespace(PolicyDomain domain,
14 const std::string& component_id) 12 const std::string& component_id)
15 : domain(domain), 13 : domain(domain),
16 component_id(component_id) {} 14 component_id(component_id) {}
17 15
18 PolicyNamespace::PolicyNamespace(const PolicyNamespace& other) 16 PolicyNamespace::PolicyNamespace(const PolicyNamespace& other)
19 : domain(other.domain), 17 : domain(other.domain),
20 component_id(other.component_id) {} 18 component_id(other.component_id) {}
21 19
22 PolicyNamespace::~PolicyNamespace() {} 20 PolicyNamespace::~PolicyNamespace() {}
23 21
24 PolicyNamespace& PolicyNamespace::operator=(const PolicyNamespace& other) { 22 PolicyNamespace& PolicyNamespace::operator=(const PolicyNamespace& other) {
25 domain = other.domain; 23 domain = other.domain;
26 component_id = other.component_id; 24 component_id = other.component_id;
27 return *this; 25 return *this;
28 } 26 }
29 27
30 bool PolicyNamespace::operator<(const PolicyNamespace& other) const { 28 bool PolicyNamespace::operator<(const PolicyNamespace& other) const {
31 return std::tie(domain, component_id) < 29 return domain < other.domain ||
32 std::tie(other.domain, other.component_id); 30 (domain == other.domain && component_id < other.component_id);
33 } 31 }
34 32
35 bool PolicyNamespace::operator==(const PolicyNamespace& other) const { 33 bool PolicyNamespace::operator==(const PolicyNamespace& other) const {
36 return domain == other.domain && component_id == other.component_id; 34 return domain == other.domain && component_id == other.component_id;
37 } 35 }
38 36
39 bool PolicyNamespace::operator!=(const PolicyNamespace& other) const { 37 bool PolicyNamespace::operator!=(const PolicyNamespace& other) const {
40 return !(*this == other); 38 return !(*this == other);
41 } 39 }
42 40
43 } // namespace policy 41 } // namespace policy
OLDNEW
« no previous file with comments | « components/mus/ws/ids.h ('k') | components/url_matcher/string_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698