summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-03 18:34:16 +0000
committerSadie Powell <sadie@witchery.services>2022-01-04 00:17:13 +0000
commit7531e90499d4cd60b6464c692725225e85c00738 (patch)
tree930fd946ea495b74c4071a67e12cadb700ab79ab /include/base.h
parentdfcc025a19d7d49179d75f34553c36e0d47eaded (diff)
Use C++11 style class/struct initialisation.
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/base.h b/include/base.h
index 09ec83edf..408f8dd16 100644
--- a/include/base.h
+++ b/include/base.h
@@ -16,9 +16,8 @@
class CoreExport Base
{
/* References to this base class */
- std::set<ReferenceBase *> *references;
+ std::set<ReferenceBase *> *references = nullptr;
public:
- Base();
virtual ~Base();
/** Adds a reference to this object. Eg, when a Reference
@@ -33,9 +32,9 @@ class CoreExport Base
class ReferenceBase
{
protected:
- bool invalid;
+ bool invalid = false;
public:
- ReferenceBase() : invalid(false) { }
+ ReferenceBase() = default;
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
virtual ~ReferenceBase() { }
inline void Invalidate() { this->invalid = true; }
@@ -48,11 +47,9 @@ template<typename T>
class Reference : public ReferenceBase
{
protected:
- T *ref;
+ T *ref = nullptr;
public:
- Reference() : ref(NULL)
- {
- }
+ Reference() = default;
Reference(T *obj) : ref(obj)
{