4 ms·
Google C++ tends towards the convention of constructors that do only cursory initialization to a sane but non-functional state, things that almost-always succee
by saalweachter 7y ago
Google C++ tends towards the convention of constructors that do only cursory initialization to a sane but non-functional state, things that almost-always succeed (and assert on failure), with the "real" initialization pushed to an Init() or Start() function.
- bruckie 7y agoNot these days, although that was true 8-9 years ago. The preferred pattern now is to use factory functions that can return either a fully-initialized object or an error.