-N.
w
Ex. 1. (20 p.).
Write a part of class template implementing a vector of elements of a parameterized type with a fixed size set during a declaration (construction). The vector should throw two kinds of exceptions for denoting invalid size of vector and for denoting invalid index of vector. The exception types should be type parameters of the template. The thrown exceptions should be constnicted by appropriate constructors without parameters. The part of codę should contain
• all necessary data members of the template,
• a constructor of vector throwing appropriate exception
• the subscript operator throwing appropriate exception (the second one) Write a piece of codę with exception handling.
Eł. 2. (20 p.)
Let us have two classes. class X (
int data.;
static X* originals[MAX]; atafclo X* copiaa[MAX]; static int nuaOfOriginals;