no message
parent
a937387844
commit
3afa15d060
|
@ -11,7 +11,11 @@
|
|||
</configurations>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="0facce0d-c642-4d80-b2fb-daf5f3e68dff" name="Default Changelist" comment="" />
|
||||
<list default="true" id="0facce0d-c642-4d80-b2fb-daf5f3e68dff" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/inc/utils.h" beforeDir="false" afterPath="$PROJECT_DIR$/inc/utils.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pattern/signleton.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/pattern/signleton.h" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -97,6 +101,8 @@
|
|||
<workItem from="1581558579086" duration="643000" />
|
||||
<workItem from="1583501235151" duration="617000" />
|
||||
<workItem from="1584890523991" duration="223000" />
|
||||
<workItem from="1585674715896" duration="786000" />
|
||||
<workItem from="1585735060761" duration="922000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
|
@ -21,4 +21,5 @@ using namespace std;
|
|||
}
|
||||
string itos(int x);
|
||||
|
||||
|
||||
#endif //CUTILS_UTILS_H
|
||||
|
|
|
@ -12,18 +12,20 @@ using namespace std;
|
|||
template <typename T> class Singletone
|
||||
{
|
||||
public:
|
||||
static T& Instance(){
|
||||
static T* Instance(){
|
||||
if(mInstance.get() == nullptr){
|
||||
mInstance = std::unique_ptr<T>();
|
||||
mInstance = std::unique_ptr<T>(new T);
|
||||
}
|
||||
return mInstance.get();
|
||||
}
|
||||
private:
|
||||
Singletone<T>(){};
|
||||
~Singletone<T>(){};
|
||||
Singletone &operator=(const Singletone&){};
|
||||
Singletone<T>(){}
|
||||
~Singletone<T>(){}
|
||||
Singletone &operator=(const Singletone&){}
|
||||
static unique_ptr<T> mInstance;
|
||||
};
|
||||
template <typename T>
|
||||
unique_ptr<T> Singletone<T>::mInstance;
|
||||
|
||||
#define DECLARE_SINGLETON(type) \
|
||||
friend class unique_ptr<type> ; \
|
||||
|
|
Loading…
Reference in New Issue