diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-07-19 03:47:20 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-07-19 03:47:20 +0000 |
commit | 5307588c579cea190110da798d498f3ffc15079f (patch) | |
tree | 09d13a6fae123a46962ad82f4b88b7c91bd08335 /factory.h | |
parent | db4981d479d967dafa5ec2f55c6a0735f897b2cb (diff) | |
download | cryptopp-git-5307588c579cea190110da798d498f3ffc15079f.tar.gz |
remove Diamond2, code size reductions
Diffstat (limited to 'factory.h')
-rw-r--r-- | factory.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -32,7 +32,7 @@ public: { for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i) { - delete i->second; + delete (ObjectFactory<AbstractClass> *)i->second; i->second = NULL; } } @@ -45,7 +45,7 @@ public: const ObjectFactory<AbstractClass> * GetFactory(const char *name) const { CPP_TYPENAME Map::const_iterator i = m_map.find(name); - return i == m_map.end() ? NULL : i->second; + return i == m_map.end() ? NULL : (ObjectFactory<AbstractClass> *)i->second; } AbstractClass *CreateObject(const char *name) const @@ -58,7 +58,8 @@ public: static ObjectFactoryRegistry<AbstractClass, instance> & Registry(...); private: - typedef std::map<std::string, ObjectFactory<AbstractClass> *> Map; + // use void * instead of ObjectFactory<AbstractClass> * to save code size + typedef std::map<std::string, void *> Map; Map m_map; }; |