-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.h
More file actions
64 lines (54 loc) · 1.47 KB
/
Array.h
File metadata and controls
64 lines (54 loc) · 1.47 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _ARRAY_H_
#define _ARRAY_H_
#include "Array_Base.h"
/**
* @class Array
*
* Basic implementation of a standard array class for chars.
*/
template <typename T>
class Array : public Array_Base <T>
{
public:
Array (void);
/**
* Initializing constructor.
*
* @param[in] length Initial size
*/
Array (size_t length);
/**
* Initializing constructor.
*
* @param[in] length Initial size
* @param[in] fill Initial value for each element
*/
Array (size_t length, T fill);
/**
* Copy constructor
*
* @param[in] arr The source array.
*/
Array (const Array & arr);
/**
* Set a new size for the array. If \a new_size is less than the current
* size, then the array is truncated. If \a new_size if greater then the
* current size, then the array is made larger and the new elements are
* not initialized to anything. If \a new_size is the same as the current
* size, then nothing happens.
*
* The array's original contents are preserved regardless of whether the
* array's size is either increased or decreased.
*
* @param[in] new_size New size of the array
*/
void resize (size_t new_size);
const Array & operator = (const Array & rhs);
void shrink ();
using Array_Base<T>::size;
using Array_Base<T>::max_size;
using Array_Base<T>::get;
using Array_Base <T>::set;
};
#include "Array.cpp"
#endif // !defined _ARRAY_H_