summaryrefslogtreecommitdiff
path: root/src/utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-11-14 00:12:15 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-11-14 00:12:15 +0000
commit04ae48c346d0c2c6d6bcd4bbb7f6ff0ab88c1bd8 (patch)
tree31609f0e6d9159f0e0c1c416e392f380c51a67e0 /src/utils.hh
parent9679b17b16fb971de2e048a1abf2d63fe83ad3ee (diff)
indent cleanup, correct erroneous 3 spaces indent
Diffstat (limited to 'src/utils.hh')
-rw-r--r--src/utils.hh58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/utils.hh b/src/utils.hh
index 0500b203..ef0cf3d5 100644
--- a/src/utils.hh
+++ b/src/utils.hh
@@ -96,52 +96,52 @@ public:
#endif
m_ptr = other.m_ptr;
return *this;
- }
+ }
- safe_ptr& operator=(safe_ptr&& other)
- {
- #ifdef KAK_DEBUG
- if (m_ptr)
- m_ptr->dec_safe_count();
- #endif
- m_ptr = other.m_ptr;
- other.m_ptr = nullptr;
- return *this;
- }
+ safe_ptr& operator=(safe_ptr&& other)
+ {
+ #ifdef KAK_DEBUG
+ if (m_ptr)
+ m_ptr->dec_safe_count();
+ #endif
+ m_ptr = other.m_ptr;
+ other.m_ptr = nullptr;
+ return *this;
+ }
- void reset(T* ptr)
- {
- *this = safe_ptr(ptr);
- }
+ void reset(T* ptr)
+ {
+ *this = safe_ptr(ptr);
+ }
- bool operator== (const safe_ptr& other) const { return m_ptr == other.m_ptr; }
- bool operator!= (const safe_ptr& other) const { return m_ptr != other.m_ptr; }
- bool operator== (T* ptr) const { return m_ptr == ptr; }
- bool operator!= (T* ptr) const { return m_ptr != ptr; }
+ bool operator== (const safe_ptr& other) const { return m_ptr == other.m_ptr; }
+ bool operator!= (const safe_ptr& other) const { return m_ptr != other.m_ptr; }
+ bool operator== (T* ptr) const { return m_ptr == ptr; }
+ bool operator!= (T* ptr) const { return m_ptr != ptr; }
- T& operator* () const { return *m_ptr; }
- T* operator-> () const { return m_ptr; }
+ T& operator* () const { return *m_ptr; }
+ T* operator-> () const { return m_ptr; }
- T* get() const { return m_ptr; }
+ T* get() const { return m_ptr; }
- explicit operator bool() const { return m_ptr; }
+ explicit operator bool() const { return m_ptr; }
private:
- T* m_ptr;
+ T* m_ptr;
};
class SafeCountable
{
public:
#ifdef KAK_DEBUG
- SafeCountable() : m_count(0) {}
- ~SafeCountable() { kak_assert(m_count == 0); }
+ SafeCountable() : m_count(0) {}
+ ~SafeCountable() { kak_assert(m_count == 0); }
- void inc_safe_count() const { ++m_count; }
- void dec_safe_count() const { --m_count; kak_assert(m_count >= 0); }
+ void inc_safe_count() const { ++m_count; }
+ void dec_safe_count() const { --m_count; kak_assert(m_count >= 0); }
private:
- mutable int m_count;
+ mutable int m_count;
#endif
};