You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
220 B

#ifndef SINGLETON_H
#define SINGLETON_H
/**
* 单例模板类
*/
template<typename T>
class Singleton{
public:
static T& instance(){
static T ins;
return ins;
}
};
#endif // SINGLETON_H