OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "tools/gn/value.h" | 5 #include "tools/gn/value.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 : type_(other.type_), | 66 : type_(other.type_), |
67 string_value_(other.string_value_), | 67 string_value_(other.string_value_), |
68 boolean_value_(other.boolean_value_), | 68 boolean_value_(other.boolean_value_), |
69 int_value_(other.int_value_), | 69 int_value_(other.int_value_), |
70 list_value_(other.list_value_), | 70 list_value_(other.list_value_), |
71 origin_(other.origin_) { | 71 origin_(other.origin_) { |
72 if (type() == SCOPE && other.scope_value_.get()) | 72 if (type() == SCOPE && other.scope_value_.get()) |
73 scope_value_ = other.scope_value_->MakeClosure(); | 73 scope_value_ = other.scope_value_->MakeClosure(); |
74 } | 74 } |
75 | 75 |
76 Value::Value(Value&& other) noexcept = default; | 76 Value::Value(Value&& other) = default; |
77 | 77 |
78 Value::~Value() { | 78 Value::~Value() { |
79 } | 79 } |
80 | 80 |
81 Value& Value::operator=(const Value& other) { | 81 Value& Value::operator=(const Value& other) { |
82 type_ = other.type_; | 82 type_ = other.type_; |
83 string_value_ = other.string_value_; | 83 string_value_ = other.string_value_; |
84 boolean_value_ = other.boolean_value_; | 84 boolean_value_ = other.boolean_value_; |
85 int_value_ = other.int_value_; | 85 int_value_ = other.int_value_; |
86 list_value_ = other.list_value_; | 86 list_value_ = other.list_value_; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // iteration code. | 214 // iteration code. |
215 return false; | 215 return false; |
216 default: | 216 default: |
217 return false; | 217 return false; |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 bool Value::operator!=(const Value& other) const { | 221 bool Value::operator!=(const Value& other) const { |
222 return !operator==(other); | 222 return !operator==(other); |
223 } | 223 } |
OLD | NEW |