]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collection.h
Use default member initializers for constant initial values
[libs/datafile.git] / source / collection.h
index fb9470d591025e8beaa9377d7cd15fba2d4e5131..98a08b6757a2c3eeed121c4c262e79248d57af02 100644 (file)
@@ -89,10 +89,9 @@ private:
        std::vector<CollectionItemTypeBase *> types;
        ItemMap items;
        std::vector<const CollectionSource *> sources;
-       Collection *fallback;
+       Collection *fallback = nullptr;
 
 public:
-       Collection();
        virtual ~Collection();
 
        /** Adds an object into the collection.  The name must not pre-exist.  The
@@ -335,7 +334,7 @@ class CollectionItemTypeBase
 protected:
        struct ExtractorBase
        {
-               virtual ~ExtractorBase() { }
+               virtual ~ExtractorBase() = default;
        };
 
        template<typename T>
@@ -348,7 +347,7 @@ protected:
        std::vector<std::string> suffixes;
        std::vector<ExtractorBase *> extractors;
 
-       CollectionItemTypeBase() { }
+       CollectionItemTypeBase() = default;
 public:
        virtual ~CollectionItemTypeBase();
 
@@ -540,7 +539,7 @@ CollectionItemTypeBase *Collection::get_type(const std::string &name) const
        for(CollectionItemTypeBase *t: types)
                if(dynamic_cast<CollectionItemType<T> *>(t))
                        return t;
-       CollectionItemTypeBase *type = 0;
+       CollectionItemTypeBase *type = nullptr;
        for(CollectionItemTypeBase *t: types)
                if(t->can_extract<T>())
                {