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

Side by Side Diff: extensions/common/permissions/base_set_operators.h

Issue 859993002: Using "static_assert" in lieu of "COMPILE_ASSERT" in extensions module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « extensions/common/constants.cc ('k') | extensions/common/permissions/permission_message.h » ('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 #ifndef EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_ 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_ 6 #define EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_
7 7
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return it_->second.get(); 62 return it_->second.get();
63 } 63 }
64 64
65 private: 65 private:
66 typename Map::const_iterator it_; 66 typename Map::const_iterator it_;
67 }; 67 };
68 68
69 BaseSetOperators() { 69 BaseSetOperators() {
70 // Ensure |T| is convertible to us, so we can safely downcast when calling 70 // Ensure |T| is convertible to us, so we can safely downcast when calling
71 // methods that must exist in |T|. 71 // methods that must exist in |T|.
72 COMPILE_ASSERT((base::is_convertible<T*, BaseSetOperators<T>*>::value), 72 static_assert((base::is_convertible<T*, BaseSetOperators<T>*>::value),
73 U_ptr_must_implicitly_convert_to_T_ptr); 73 "U ptr must implicitly convert to T ptr");
74 } 74 }
75 75
76 BaseSetOperators(const T& set) { 76 BaseSetOperators(const T& set) {
77 this->operator=(set); 77 this->operator=(set);
78 } 78 }
79 79
80 ~BaseSetOperators() {} 80 ~BaseSetOperators() {}
81 81
82 T& operator=(const T& rhs) { 82 T& operator=(const T& rhs) {
83 return Assign(rhs); 83 return Assign(rhs);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 map_.clear(); 279 map_.clear();
280 } 280 }
281 281
282 private: 282 private:
283 Map map_; 283 Map map_;
284 }; 284 };
285 285
286 } // namespace extensions 286 } // namespace extensions
287 287
288 #endif // EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_ 288 #endif // EXTENSIONS_COMMON_PERMISSIONS_BASE_SET_OPERATORS_H_
OLDNEW
« no previous file with comments | « extensions/common/constants.cc ('k') | extensions/common/permissions/permission_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698