aboutsummaryrefslogtreecommitdiff
path: root/dep/include/zthread/CountedPtr.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-12 17:09:15 -0600
committermegamage <none@none>2009-02-12 17:09:15 -0600
commit6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch)
tree91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/include/zthread/CountedPtr.h
parent2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff)
parentf385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'dep/include/zthread/CountedPtr.h')
-rw-r--r--dep/include/zthread/CountedPtr.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/dep/include/zthread/CountedPtr.h b/dep/include/zthread/CountedPtr.h
index a4dcc6ef248..095b61c7ab5 100644
--- a/dep/include/zthread/CountedPtr.h
+++ b/dep/include/zthread/CountedPtr.h
@@ -36,7 +36,7 @@
#endif
namespace ZThread {
-
+
/**
* @class CountedPtr
*
@@ -100,41 +100,41 @@ namespace ZThread {
~CountedPtr() {
if(_count && --(*_count) == 0) {
-
- if(_instance)
+
+ if(_instance)
delete _instance;
delete _count;
-
+
}
}
-
+
#if !defined(__MWERKS__)
#if !defined(_MSC_VER) || (_MSC_VER > 1200)
const CountedPtr& operator=(const CountedPtr& ptr) {
-
+
typedef CountedPtr<T, CountT> ThisT;
ThisT(ptr).swap(*this);
return *this;
- }
+ }
#endif
#endif
template <typename U, typename V>
const CountedPtr& operator=(const CountedPtr<U, V>& ptr) {
-
+
typedef CountedPtr<T, CountT> ThisT;
ThisT(ptr).swap(*this);
return *this;
- }
+ }
void reset() {
@@ -155,7 +155,7 @@ namespace ZThread {
#endif
#endif
-
+
template <typename U, typename V>
void swap(CountedPtr<U, V>& ptr) {
@@ -221,7 +221,7 @@ namespace ZThread {
assert(_instance != 0);
return _instance;
}
-
+
bool operator!() const {
return _instance == 0;
}
@@ -229,25 +229,25 @@ namespace ZThread {
operator bool() const {
return _instance != 0;
}
-
+
}; /* CountedPtr */
- template<typename U, typename V, typename X, typename Y>
+ template<typename U, typename V, typename X, typename Y>
inline bool operator<(CountedPtr<U, V> const &lhs, CountedPtr<X, Y> const &rhs) {
return lhs.less(rhs);
}
- template<typename U, typename V, typename X, typename Y>
+ template<typename U, typename V, typename X, typename Y>
inline bool operator==(CountedPtr<U, V> const &lhs, CountedPtr<X, Y> const &rhs) {
return lhs.equal(rhs.get);
}
- template<typename U, typename V, typename X, typename Y>
+ template<typename U, typename V, typename X, typename Y>
inline bool operator!=(CountedPtr<U, V> const &lhs, CountedPtr<X, Y> const &rhs) {
return !(lhs.equal(rhs.get));
}
- template<typename U, typename V, typename X, typename Y>
+ template<typename U, typename V, typename X, typename Y>
inline void swap(CountedPtr<U, V> const &lhs, CountedPtr<X, Y> const &rhs) {
lhs.swap(rhs);
}
@@ -260,17 +260,17 @@ namespace ZThread {
return lhs.less(rhs);
}
- template<typename U, typename V>
+ template<typename U, typename V>
inline bool operator==(CountedPtr<U, V> const &lhs, CountedPtr<U, V> const &rhs) {
return lhs.equal(rhs.get);
}
- template<typename U, typename V>
+ template<typename U, typename V>
inline bool operator!=(CountedPtr<U, V> const &lhs, CountedPtr<U, V> const &rhs) {
return !(lhs.equal(rhs.get));
}
- template<typename U, typename V>
+ template<typename U, typename V>
inline void swap(CountedPtr<U, V> const &lhs, CountedPtr<U, V> const &rhs) {
lhs.swap(rhs);
}
@@ -283,7 +283,7 @@ namespace ZThread {
#ifdef _MSC_VER
# pragma warning(pop)
# pragma warning(pop)
-#endif
+#endif
#endif // __ZTCOUNTEDPTR_H__