/* * array_storage_policy-test.cc */ #include #include "smart_pointer.h" #include "testutils.icc" using namespace std; typedef smart_pointer Smart_Pointer; int main() try { Smart_Pointer sp1{ new X[10] }; // Array with ten X is created here. for (int i = 0; i < 10; ++i) cout << (sp1 + i)->get_m() << endl; return 0; // Ten X are now to be destructed. } catch (const exception& e) { cout << e.what() << endl; } catch (...) { cout << "Caught an exception not of type 'exception'" << endl; }