diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-19 03:47:20 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-19 03:47:20 +0000 |
commit | 153b79ef5d9b042b23eba9aa332ec025bbc3300e (patch) | |
tree | 09d13a6fae123a46962ad82f4b88b7c91bd08335 /factory.h | |
parent | 609446928f2c6f2e51cc906a037cd79ef4dfd312 (diff) | |
download | cryptopp-153b79ef5d9b042b23eba9aa332ec025bbc3300e.tar.gz |
remove Diamond2, code size reductions
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@107 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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; }; |