So I have a function like this that does lazy initialization:
Wrapper& getWrapper() {
// initialization code
return gWrapper;
}
But the initialization code isn't trivial and I want to only run it that once im actually constructing the gWrapper. Other times, it should just return gWrapper immediately. How can I best do this?