dde-dock/frame/util/singleton.h
tsic404 068f35e405 chore: remove std namespace
log: as title
2023-07-24 06:52:40 +00:00

26 lines
508 B
C++

// Copyright (C) 2016 Deepin Technology Co., Ltd.
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#include <memory>
template <class T>
class Singleton
{
public:
static inline T *instance() {
static T* _instance = new T;
return _instance;
}
protected:
Singleton(void) {}
~Singleton(void) {}
Singleton(const Singleton &) {}
Singleton &operator= (const Singleton &) {}
};