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

Side by Side Diff: base/values.cc

Issue 2769283002: Enable noexcept on Windows, use for a few move constructors. (Closed)
Patch Set: Landmine Created 3 years, 9 months 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 | « base/values.h ('k') | build/config/compiler/BUILD.gn » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/values.h" 5 #include "base/values.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 std::unique_ptr<BinaryValue> BinaryValue::CreateWithCopiedBuffer( 84 std::unique_ptr<BinaryValue> BinaryValue::CreateWithCopiedBuffer(
85 const char* buffer, 85 const char* buffer,
86 size_t size) { 86 size_t size) {
87 return MakeUnique<BinaryValue>(std::vector<char>(buffer, buffer + size)); 87 return MakeUnique<BinaryValue>(std::vector<char>(buffer, buffer + size));
88 } 88 }
89 89
90 Value::Value(const Value& that) { 90 Value::Value(const Value& that) {
91 InternalCopyConstructFrom(that); 91 InternalCopyConstructFrom(that);
92 } 92 }
93 93
94 Value::Value(Value&& that) { 94 Value::Value(Value&& that) noexcept {
95 InternalMoveConstructFrom(std::move(that)); 95 InternalMoveConstructFrom(std::move(that));
96 } 96 }
97 97
98 Value::Value() : type_(Type::NONE) {} 98 Value::Value() : type_(Type::NONE) {}
99 99
100 Value::Value(Type type) : type_(type) { 100 Value::Value(Type type) : type_(type) {
101 // Initialize with the default value. 101 // Initialize with the default value.
102 switch (type_) { 102 switch (type_) {
103 case Type::NONE: 103 case Type::NONE:
104 return; 104 return;
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 } 1325 }
1326 1326
1327 std::ostream& operator<<(std::ostream& out, const Value::Type& type) { 1327 std::ostream& operator<<(std::ostream& out, const Value::Type& type) {
1328 if (static_cast<int>(type) < 0 || 1328 if (static_cast<int>(type) < 0 ||
1329 static_cast<size_t>(type) >= arraysize(kTypeNames)) 1329 static_cast<size_t>(type) >= arraysize(kTypeNames))
1330 return out << "Invalid Type (index = " << static_cast<int>(type) << ")"; 1330 return out << "Invalid Type (index = " << static_cast<int>(type) << ")";
1331 return out << Value::GetTypeName(type); 1331 return out << Value::GetTypeName(type);
1332 } 1332 }
1333 1333
1334 } // namespace base 1334 } // namespace base
OLDNEW
« no previous file with comments | « base/values.h ('k') | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698