Răsfoiți Sursa

core: Delete System copy/move constructors and assignment operators

Prevents potentially making copies or doing silly things by accident
with the System instance, particularly given our current core is
designed (unfortunately) around one instantiable instance.

This will prevent the accidental case of:

auto instance = System::Instance();

being compiled without warning when it's supposed to be:

auto& instance = System::Instance();
Lioncash 8 ani în urmă
părinte
comite
a0ce6de913
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      src/core/core.h

+ 6 - 0
src/core/core.h

@@ -40,6 +40,12 @@ namespace Core {
 
 class System {
 public:
+    System(const System&) = delete;
+    System& operator=(const System&) = delete;
+
+    System(System&&) = delete;
+    System& operator=(System&&) = delete;
+
     ~System();
 
     /**