]> git.tdb.fi Git - libs/datafile.git/commitdiff
Make move constructors explicitly declared for MSVC's benefit
authorMikko Rasa <tdb@tdb.fi>
Tue, 26 Dec 2023 23:36:29 +0000 (01:36 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 27 Dec 2023 22:07:20 +0000 (00:07 +0200)
When exporting classes it wants to export all the special members, even
if some of them are invalid due to the types of data members.  A user-
declared move constructor disables the implicit copy constructor so
things will work correctly.

source/collection.h
source/packsource.h

index f2e156e6634ef8917a117e77444039f0227976e8..254c7b675c88c5bfc39bc11da277be725d0b9e6d 100644 (file)
@@ -332,6 +332,8 @@ protected:
        std::vector<std::unique_ptr<ExtractorBase>> extractors;
 
        CollectionItemTypeBase() = default;
+       CollectionItemTypeBase(CollectionItemTypeBase &&) = default;
+       CollectionItemTypeBase &operator=(CollectionItemTypeBase &&) = default;
 
        void set_keyword(const std::string &);
        void add_suffix(const std::string &);
index aea3b683603f9e9efc63537cc245a6ee589a5a52..d7bec4a46feaee36700cf46dfdce06009aa9cc84 100644 (file)
@@ -116,6 +116,10 @@ private:
        ObjectMap objects;
 
 public:
+       PackSource() = default;
+       PackSource(PackSource &&) = default;
+       PackSource &operator=(PackSource &&) = default;
+
        /// Adds a pack file to load objects from.  The index is read immediately.
        void add_pack_file(const std::string &);