Re: C++ initialization mess
Posted: Tue Aug 02, 2011 9:25 pm
I think I found your picturegravaera wrote:Yo:
stripped
--Peace out
gravaera
The Place to Start for Operating System Developers
http://f.osdev.org/
I think I found your picturegravaera wrote:Yo:
stripped
--Peace out
gravaera
He said he didn't have support for exceptions. Since he said he wants to stop initialising (i.e. panic) if there's an error, I'd just do this: (where panic(const char*) is the kernel panic function that displays a message and loops forever)Owen wrote:The method that makes sense to me is...i.e. using the language as intended, and letting RAII clean up afterwardsCode: Select all
Class::Class() { tryAndDoSomeInitializationStuff(); if(thatFailed) throw SomeException(maybeWithSomeInformation); }
Code: Select all
Class::Class()
{
tryAndDoSomeInitializationStuff();
if(thatFailed) panic("Unable to initialize stuff");
}
Hey, that's racist.Love4Boobies wrote:I think I found your picture