mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-25 08:28:06 +03:00
Define code style and format all source file using clang-format-14
except those placed in 3rdparty directories.
This commit is contained in:
@@ -32,28 +32,27 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace LimeReport{
|
||||
namespace LimeReport {
|
||||
|
||||
template <typename T>
|
||||
class Singleton
|
||||
{
|
||||
template <typename T> class Singleton {
|
||||
public:
|
||||
static T& instance(){
|
||||
if (0==inst){
|
||||
static T& instance()
|
||||
{
|
||||
if (0 == inst) {
|
||||
inst = new T();
|
||||
::atexit( destroy );
|
||||
} else {};
|
||||
::atexit(destroy);
|
||||
} else {
|
||||
};
|
||||
return *inst;
|
||||
}
|
||||
|
||||
private:
|
||||
static T* inst;
|
||||
|
||||
private:
|
||||
static void destroy() {
|
||||
delete inst;
|
||||
}
|
||||
static void destroy() { delete inst; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T* Singleton< T >::inst =0;
|
||||
}
|
||||
template <typename T> T* Singleton<T>::inst = 0;
|
||||
} // namespace LimeReport
|
||||
#endif // LRSINGLETON_H
|
||||
|
||||
Reference in New Issue
Block a user