We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0709c68 commit 6de8599Copy full SHA for 6de8599
core/include/codspeed.h
@@ -6,8 +6,11 @@
6
7
class CodSpeed {
8
public:
9
- // Constructor
10
- CodSpeed();
+ // Public static method to access the single instance
+ static CodSpeed *getInstance() {
11
+ static CodSpeed instance;
12
+ return &instance;
13
+ }
14
15
// Member functions
16
void push_group(const std::string &group);
@@ -16,6 +19,8 @@ class CodSpeed {
19
void end_benchmark();
17
20
18
21
private:
22
+ // Private constructor to prevent direct instantiation
23
+ CodSpeed();
24
std::vector<std::string> benchmarked;
25
std::string current_benchmark;
26
std::vector<std::string> group_stack;
0 commit comments