I'm pretty new to exceptions, so please bear with me...
I have a few objects that are supposed to last the lifetime of the program and are set up so they commonly throw exceptions on construction. I hoped I'd be able to just wrap the object declarations (in main()) with a try/catch block and then use them further down the program without hassle. Then I realised the try scope is limited to that try block.
I gather that when an exception is thrown, the os (or the program?) runs down the function stack until it finds a suitable handler, abort()ing if one doesn't exist. That makes exception run in linear time w.r.t. the number of functions between throw and catch then, right? So, surely having my entire program between the throw and catches isn't exactly efficient when these throws are expected to be common?
How do people here generally deal with it? Is the function crawling even noticeable?