]> git.tdb.fi Git - libs/game.git/commitdiff
Explicitly declare special members of certain classes
authorMikko Rasa <tdb@tdb.fi>
Sun, 26 Jan 2025 20:43:06 +0000 (22:43 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 27 Jan 2025 11:28:31 +0000 (13:28 +0200)
MSVC tries to generate them for DLL export and that fails because of
vectors of unique pointers.

source/game/reflection.h
source/game/spawner.h
source/game/system.h

index a49048ffb4b23e989966ff0c353793a488cbd8ee..fd2b739ab9d934d0aacf504432fabdaae81b1aec 100644 (file)
@@ -104,6 +104,12 @@ private:
        std::vector<std::unique_ptr<ClassBase>>::const_iterator lower_bound(const std::type_index &) const;
 
 public:
+       Reflector() = default;
+       Reflector(const Reflector &) = delete;
+       Reflector &operator=(const Reflector &) = delete;
+       Reflector(Reflector &&) = default;
+       Reflector &operator=(Reflector &&) = default;
+
        ClassBase *find_class(const std::type_index &) const;
 
        template<typename T>
index e9d9673dded076dfe04b6dd5cb214a0bef618072..b89bb3e6ba9ba332a43a358a3975e3170c23e258 100644 (file)
@@ -53,6 +53,10 @@ private:
 
 public:
        Spawner(Stage &, Replicator *, Handle<Entity>, SpawningHandler &);
+       Spawner(const Spawner &) = delete;
+       Spawner &operator=(const Spawner &) = delete;
+       Spawner(Spawner &&) = default;
+       Spawner &operator=(Spawner &&) = default;
 
        template<typename T>
                requires std::is_base_of_v<Entity, T>
index ec1fb61b1af277e2a5a0dcfcd04f4d1ea8796bfd..4f4c1a6ba3a0d9246146fda443cbbc56838bc7d5 100644 (file)
@@ -11,7 +11,7 @@
 
 namespace Msp::Game {
 
-class MSPGAME_API System
+class MSPGAME_API System: public NonCopyable
 {
 public:
        using PolymorphicBase = System;