I'm trying to mock a singleton class, and following the suggestion here: #196, I am getting this:
<source>: In function 'int main()':
<source>:22:19: error: use of deleted function 'MockSingleton::MockSingleton()'
22 | MockSingleton _mock;
| ^~~~~
<source>:16:7: note: 'MockSingleton::MockSingleton()' is implicitly deleted because the default definition would be ill-formed:
16 | class MockSingleton : public Singleton {
| ^~~~~~~~~~~~~
<source>:16:7: error: 'Singleton::Singleton()' is private within this context
<source>:10:18: note: declared private here
10 | explicit Singleton() { text = "Hello World!"; };
| ^~~~~~~~~
Compiler returned: 1
I'm trying to mock a singleton class, and following the suggestion here: #196, I am getting this:
https://godbolt.org/z/4qzcorbGn
Not exactly sure if I have formed things correctly, or I'm missing something more.
I guess this issue is more about adding documentation specific to singletons rather than change anything in the code.