blob: 760fe4d13fc3f877a7fc88438eff707a2eeeca85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef PRIVATECTOR_H
#define PRIVATECTOR_H
#include "libsamplemacros.h"
class PrivateCtor
{
public:
inline static PrivateCtor* instance()
{
static PrivateCtor self;
self.m_instanciations++;
return &self;
}
inline int instanceCalls()
{
return m_instanciations;
}
private:
int m_instanciations;
PrivateCtor() : m_instanciations(0) {}
};
class DeletedDefaultCtor
{
public:
DeletedDefaultCtor() = delete;
DeletedDefaultCtor(const DeletedDefaultCtor &) = default;
DeletedDefaultCtor(DeletedDefaultCtor &&) = default;
DeletedDefaultCtor &operator=(const DeletedDefaultCtor &) = default;
DeletedDefaultCtor &operator=(DeletedDefaultCtor &&) = default;
~DeletedDefaultCtor() = default;
};
#endif
|