2 ms·
or just: Foo &getInstance() { static Foo instance; return instance; } Guaranteed to be threadsafe by the standard, even.
by rcxdude 3y ago
or just:
Foo &getInstance() {
static Foo instance;
return instance;
}
Guaranteed to be threadsafe by the standard, even.