-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.hpp
More file actions
42 lines (33 loc) · 728 Bytes
/
Array.hpp
File metadata and controls
42 lines (33 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <cstddef>
#include <exception>
template <typename T> class Array
{
private:
T *_array;
size_t _size;
public:
Array ();
Array (const Array &other);
Array<T> &operator= (const Array<T> &rhs);
~Array ();
Array (size_t n);
size_t size () const;
T &operator[] (size_t i);
const T &operator[] (size_t i) const;
;
class OutOfLimitsException : public std::exception
{
virtual const char *what () const throw ();
};
class InvalidArraySize : public std::exception
{
virtual const char *what () const throw ();
};
class EmptyArray : public std::exception
{
virtual const char *what () const throw ();
};
};
#define MAX_SIZE 1000
#include "../src/Array.tpp"