I just realised I made a class member static unnecessarily. I wondered whether it made sense, or what the difference is between them. So I have:
struct Log
{
int a;
std::string text;
};
struct GUI
{
GUI() = delete;
static void doSomething() {}
static inline int a;
static inline Foo fooObj;
};
or
struct GUI2
{
GUI2() = delete;
static void doSomething() {}
int a;
Foo fooObj;
};
So you can see that this GUI class is always going to be accessed with the scope operator GUI:: instead of the dot member operator, I won't be creating any instances of it, it's completely static. So the int and the Foo object in the two GUI classes either have the "static" keyword or not. In the case where the GUI classes won't be instantiated I don't believe this will make a difference. As a matter of best practice is it better to leave the static keyword out? Also, what if any difference is there between the two? I just noticed I think it makes no difference in my case.