I'm wondering what the best way to define the value of a static data member within a class is. The values I want to initialise the data to is the same throughout the entire life of the program, but is calculated on runtime. Currently I'm calculating this in the class constructor, but this is causing major cpu overheads when creating multiple objects of the class. Is there a better way to do this so the initialisation is only performed once? I'm either thinking I could move the calculation out of the constructor and into an initialisation function, but was hoping there was a neater way of doing this.
Any suggestions would be hugely appreciated,