I think I found your picturegravaera wrote:Yo:
stripped
--Peace out
gravaera
C++ initialization mess
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: C++ initialization mess
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: C++ initialization mess
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");
}
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: C++ initialization mess
Hey, that's racist.Love4Boobies wrote:I think I found your picture
Re: C++ initialization mess
What, the picture or the "Yo!"?
Every good solution is obvious once you've found it.
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: C++ initialization mess
I think it's just a L4B thing
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.