Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

template<typename T>
static exception_trap<T>* stdx::new_exception_trap ( const T &  aTrapped  )  [inline, static]

Convenience function that allocates a new exception_trap instance on the heap by automatically deducing the exception_trap template argument from the type of the exception passed in aTrapped.

The following two lines of code inside the catch block are equivalent:

    using namespace std;
    using namespace stdx;
    catch (const MyException &err)
      auto_ptr <exception_trap_base> t1 = new exception_trap <MyException> (err);
      auto_ptr <exception_trap_base> t2 = new_exception_trap (err);

aTrapped Exception to put to the allocated trap.
Allocated exception_trap object.

Definition at line 347 of file cpputils.h.

    return new exception_trap <T> (aTrapped);

Generated by  Doxygen 1.6.0   Back to index