5 ms·
Why? Isn't one of the ideas of C++ that every constructed object is in a valid state? Even the STL has constructors that can fail, and it does it through member
by nmilo 5y ago
Why? Isn't one of the ideas of C++ that every constructed object is in a valid state? Even the STL has constructors that can fail, and it does it through member variables/flags, which doesn't seem like a very good solution:
std::fstream s(filename);
if (!s.is_open()) {
std::cout << "failed to open " << filename << '\n';
}
No one should ever have to use factories, they really suck. Too much boilerplate, too much code duplication.
- jcelerier 5y agohow do you do non-trivial dynamically-loaded plug-ins without factories ?