the template code is like this:
模板代码是这样的:
template <class type1>
struct DefaultInstanceCreator {
type1 * operator ()() {
return new type1;
}
};
template < class type1
, class InstanceCreator = DefaultInstanceCreator<type1> >
class objectCache
{
public:
objectCache (InstanceCreator & instCreator)
:instCreator_ (instCreator) {}
type1* Get() {
type1 * temp = instCreator_ ();
}
private:
InstanceCreator instCreator_;
};
t