I am fairly new to C++ and I was wondering why we return the pointer of an instance when using a singleton?
I am using the one mentioned here: https://refactoring.guru/design-patterns/singleton/cpp/example
As the getInstance function states we return a pointer of itself, but why? Can someone explain me so I understand the point of it better? Why don't we just return the object itself?
I have a C# background so the pointer story is a bit confusing for me, I googled a lot about it already but I don't really get the sense of it yet.