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

Unified Diff: base/containers/small_map.h

Issue 2363023002: Clean up my TODO comments in SmallMap and Time. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/time/time.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/small_map.h
diff --git a/base/containers/small_map.h b/base/containers/small_map.h
index ed96caf1381c6ce2a9815196b17fd2a41446e6c8..2945d58769f28ca4dc2009ddb3d292dc692cd311 100644
--- a/base/containers/small_map.h
+++ b/base/containers/small_map.h
@@ -575,17 +575,13 @@ class SmallMap {
// We want to call constructors and destructors manually, but we don't
// want to allocate and deallocate the memory used for them separately.
- // So, we use this crazy ManualConstructor class.
+ // So, we use this crazy ManualConstructor class. Since C++11 it's possible
+ // to use objects in unions like this, but the ManualDestructor syntax is
+ // a bit better and doesn't have limitations on object type.
//
// Since array_ and map_ are mutually exclusive, we'll put them in a
- // union, too. We add in a dummy_ value which quiets MSVC from otherwise
- // giving an erroneous "union member has copy constructor" error message
- // (C2621). This dummy member has to come before array_ to quiet the
- // compiler.
- //
- // TODO(brettw) remove this and use C++11 unions when we require C++11.
+ // union.
union {
- ManualConstructor<value_type> dummy_;
ManualConstructor<value_type> array_[kArraySize];
ManualConstructor<NormalMap> map_;
};
« no previous file with comments | « no previous file | base/time/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698