#include <iostream>     // std::cout
#include <exception>    // std::exception
#include <new>          // std::bad_array_new_length
class raii_test
{ 
    public:
    raii_test()
    {
    	   // assume some file is opened
           std::cout<<"Ctor\n";
    }
    ~raii_test()
    { 
    	   // assume that file is closed
           std::cout<<"Dtor\n";
    }
};

int main() {
  raii_test t;
  int* p = new int[-1];    // throws bad_array_new_length exception
}