summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 19:59:43 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 19:59:43 +0000
commit3e792af86043c1414149cd05488a2bebe787c767 (patch)
treeb04f32e64b7d2d369c93d03f2353271c701bf2bc /o3d
parent69cdaf7fac503a8ef862b5e50f80f7d3c1b985cc (diff)
downloadchromium_src-3e792af86043c1414149cd05488a2bebe787c767.zip
chromium_src-3e792af86043c1414149cd05488a2bebe787c767.tar.gz
chromium_src-3e792af86043c1414149cd05488a2bebe787c767.tar.bz2
Fixed broken Linux build by changing Counter helper class used by
NumElements() from a local class to a nested class as Gregg suggested in http://codereview.chromium.org/574024 . Changed this class to use DISALLOW_COPY_AND_ASSIGN. Review URL: http://codereview.chromium.org/606025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/core/cross/gpu2d/red_black_tree.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/o3d/core/cross/gpu2d/red_black_tree.h b/o3d/core/cross/gpu2d/red_black_tree.h
index 17e1e0a..7dd7446 100644
--- a/o3d/core/cross/gpu2d/red_black_tree.h
+++ b/o3d/core/cross/gpu2d/red_black_tree.h
@@ -148,27 +148,6 @@ class RedBlackTree {
// Returns the number of elements in the tree.
int NumElements() {
- // A Visitor which simply counts the number of visited elements.
- class Counter : public Visitor {
- public:
- Counter() : count_(0) {}
-
- virtual void Visit(const T& data) {
- ++count_;
- }
-
- int count() {
- return count_;
- }
-
- private:
- int count_;
- // Using the DISALLOW_COPY_AND_ASSIGN macro for this local class
- // breaks compilation on Windows because the declarations do not
- // have method bodies.
- Counter(const Counter&) {}
- void operator=(const Counter&) {}
- };
Counter counter;
VisitInorder(&counter);
return counter.count();
@@ -697,6 +676,27 @@ class RedBlackTree {
}
//----------------------------------------------------------------------
+ // Helper class for NumElements()
+
+ // A Visitor which simply counts the number of visited elements.
+ class Counter : public Visitor {
+ public:
+ Counter() : count_(0) {}
+
+ virtual void Visit(const T& data) {
+ ++count_;
+ }
+
+ int count() {
+ return count_;
+ }
+
+ private:
+ int count_;
+ DISALLOW_COPY_AND_ASSIGN(Counter);
+ };
+
+ //----------------------------------------------------------------------
// Verification and debugging routines
//