// out_of_range.cpp
// compile with: /EHsc /GR
#include <string>
#include <iostream>
using namespace std;
int main() {
// out_of_range
try {
string str( "Micro" );
string rstr( "soft" );
str.append( rstr, 5, 3 );
cout << str << endl;
}
catch ( exception &e ) {
cerr << "Caught: " << e.what( ) << endl;
cerr << "Type: " << typeid( e ).name( ) << endl;
};
}