Small style stuff
[zxing.git] / cpp / core / src / zxing / common / Counted.h
index dd0f845..306ed6c 100644 (file)
@@ -5,8 +5,7 @@
  *  Counted.h
  *  zxing
  *
- *  Created by Christian Brunschen on 07/05/2008.
- *  Copyright 2008 Google UK. All rights reserved.
+ *  Copyright 2010 ZXing authors All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -172,10 +171,10 @@ public:
   T& operator*() {
     return *object_;
   }
-  T* operator->() {
+  T* operator->() const {
     return object_;
   }
-  operator T*() {
+  operator T*() const {
     return object_;
   }
 
@@ -194,6 +193,10 @@ public:
     return x == 0 ? object_ != 0 : true;
   }
 
+  bool empty() const {
+    return object_ == 0;
+  }
+
   template<class Y>
   friend std::ostream& operator<<(std::ostream &out, Ref<Y>& ref);
 };