摘要:
base.hpp的代码:#ifndef_H_DYNAMIC_H#define_H_DYNAMIC_H#include"Base.h"#include<iostream>#include<map>usingnamespacestd;template<typenameT>Base*createT(){returnnewT;}structBaseFactory{typedefstd::map<std::string,Base*(*)()>map_type;staticBase*createInstance(std::stringco 阅读全文