Page 2 of 2

Re: C++ initialization mess

Posted: Tue Aug 02, 2011 9:25 pm
by Love4Boobies
gravaera wrote:Yo:

stripped

--Peace out
gravaera
I think I found your picture :lol:

Image

Re: C++ initialization mess

Posted: Tue Aug 02, 2011 9:40 pm
by immibis
Owen wrote:The method that makes sense to me is...

Code: Select all

Class::Class()
{
    tryAndDoSomeInitializationStuff();
    if(thatFailed) throw SomeException(maybeWithSomeInformation);
}
i.e. using the language as intended, and letting RAII clean up afterwards
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)

Code: Select all

Class::Class()
{
    tryAndDoSomeInitializationStuff();
    if(thatFailed) panic("Unable to initialize stuff");
}

Re: C++ initialization mess

Posted: Tue Aug 02, 2011 11:58 pm
by Brynet-Inc
Love4Boobies wrote:I think I found your picture :lol:
Hey, that's racist.

Re: C++ initialization mess

Posted: Wed Aug 03, 2011 1:40 am
by Solar
What, the picture or the "Yo!"? 8)

Re: C++ initialization mess

Posted: Wed Aug 03, 2011 4:30 am
by gravaera
I think it's just a L4B thing :P