]> git.tdb.fi Git - libs/datafile.git/commitdiff
Use plain function pointer instead of std::function
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 18:53:33 +0000 (20:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 18:53:33 +0000 (20:53 +0200)
The lambda ended up having no captures, so this works.

source/dynamicobjectloader.h

index ee1827bbd067f10e32123bde3e484743e64d0495..9706c957e7403eba40960e016d79dec1171fb8ac 100644 (file)
@@ -34,7 +34,7 @@ protected:
        T *object;
 private:
        Loader *obj_loader;
-       std::function<void(Collection &, const std::string &, T *)> store_func;
+       void (*store_func)(Collection &, const std::string &, T *);
 
        static ActionMap shared_actions;
 
@@ -72,7 +72,8 @@ template<typename T, typename C>
 DynamicObjectLoader<T, C>::DynamicObjectLoader(Collection *c):
        coll(c),
        object(nullptr),
-       obj_loader(nullptr)
+       obj_loader(nullptr),
+       store_func(nullptr)
 {
        set_actions(shared_actions);
 }