using new in constructor

I read on the net it was a bad idea to allocate new memory in the constructor or generally any initialization that can fail should be moved to its own function.

can someone explain this or offer some more information on this.
If memory allocation with new fails it will throw an exception, nothing wrong with that. People are just stupid.
On the contrary, the constructor is the ideal place for memory allocation and other resource acquisition. See http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
ok i guess its true you dont believe everything you read on the internet ehe. thanks guys.
Topic archived. No new replies allowed.