From: Mikko Rasa Date: Sun, 20 Apr 2014 09:53:33 +0000 (+0300) Subject: Use dynamic_cast to support Collection as virtual base class X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=acf0e00b9e45615c5f10777d764100c2c086acab;p=libs%2Fdatafile.git Use dynamic_cast to support Collection as virtual base class --- diff --git a/source/collection.h b/source/collection.h index 5f0650c..174c7fc 100644 --- a/source/collection.h +++ b/source/collection.h @@ -380,7 +380,7 @@ private: Creator(FuncPtr f): func(f) { } virtual T *create(Collection &coll, const std::string &name) const - { return (static_cast(coll).*func)(name); } + { return (dynamic_cast(coll).*func)(name); } }; template