blob: b49ff85ff1313da3da939b6aa5c53f193da1a1f6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
#include <stdexcept>
#include "Vector.h"
using namespace std;
void
neg_length ()
{
try { Vector v (-27); }
catch (length_error) { cout << "it's alright" << endl; }
catch (bad_alloc) { cout << "BIG OOF!" << endl; }
}
int
main ()
{
neg_length ();
}
|