Re: [Flightgear-devel] try ... catch ... throw (up)

2005-11-12 Thread Vassilii Khachaturov
Here's what I'm doing: In the Table class: In FGTable constructor: if (operation_types.find(parent_type) == string::npos) { internal = true; } else { throw(string(An internal table cannot be ...)); } Now, this seems to work OK - I throw an exception if a situation occurs that is

RE: [Flightgear-devel] try ... catch ... throw (up)

2005-11-12 Thread Jon Berndt
Vassilii Khachaturov wrote: I am unsure it is OK to through a temporary object like this. It's created on the stack right there at the same frame where it's thrown, but IIRC, as throw unwinds the stack, it is auto-destructed. You should be throwing an object that has lifetime encompassing