summaryrefslogtreecommitdiff
path: root/node/SharedPtr.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-13 13:26:27 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-13 13:26:27 -0400
commit3e49337d9a773a5d805a908bc093b5d72985d8d9 (patch)
treedd8bf524287442c1c3a30f9390d712b77c0e53d0 /node/SharedPtr.hpp
parentc6dd5b239ff30a192c5bc6e784fd5d4b3085646d (diff)
downloadinfinitytier-3e49337d9a773a5d805a908bc093b5d72985d8d9.tar.gz
infinitytier-3e49337d9a773a5d805a908bc093b5d72985d8d9.zip
Add a fast non-cryptographic PRNG.
Diffstat (limited to 'node/SharedPtr.hpp')
-rw-r--r--node/SharedPtr.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/node/SharedPtr.hpp b/node/SharedPtr.hpp
index 014e34fa..a31e135e 100644
--- a/node/SharedPtr.hpp
+++ b/node/SharedPtr.hpp
@@ -88,6 +88,14 @@ public:
return *this;
}
+ inline void swap(SharedPtr &with)
+ throw()
+ {
+ T *tmp = _ptr;
+ _ptr = with._ptr;
+ with._ptr = tmp;
+ }
+
inline operator bool() const throw() { return (_ptr); }
inline T &operator*() const throw() { return *_ptr; }
inline T *operator->() const throw() { return _ptr; }