I'm doing an exercise to convert an existing Factory Pattern implemented with the Singleton Pattern into a Factory Pattern implemented with the Monostate Pattern.
The Factory Pattern has 3 data members, 1) a string, 2) a double, and 3) a map.
The problem I've run into is in trying to make all the data members static, I don't know how make a data member of type map static. Doing so results in LNK2001 errors on compile. I'm not 100% as to why but my guess is that it's due to map being a variable container?
Relating back to the overarching problem, RegisterPayOff() is not working as when CreatePayOff() is called, the PayOffFactory object can't find the PayOffId in TheCreatorFunctions. I thought the problem might be because I don't have all the data members as static yet.
So does the line initialise (or create?) another instance of TheCreatorFunctions? My vague understanding of static data members was that they come into existence the moment they are declared (and so aren't defined).
Then have I inserted the line in right place above? Another compile error LNK1120 is reported.