News for hackers. Stuff that matters.
Re:A brief introduction to C++'s model for type- and resourc... by vvanders on Friday January 15, 2016 @01:00PM (#10910896)
Sorry, I should have clarified that the init function is usually static so you can invoke with it returning an object + possible error code if you never want an object in an invalid state.

FWIW some quick googling shows that having a constructor acquire a resource is not a requirement(https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Resource_A...). The important part about RAII is that the automatic releasing of resources when out of scope(through a no-throw destructor).

There are no comments on this comment yet.