-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpr_Command_Iterator.cpp
More file actions
49 lines (35 loc) · 922 Bytes
/
Expr_Command_Iterator.cpp
File metadata and controls
49 lines (35 loc) · 922 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
43
44
45
46
47
48
49
// -*- C++ -*-
// Honor Pledge:
//
// I pledge that I have neither given nor receieved any help
// on this assignment.
template <typename T>
Expr_Command_Iterator <T>::Expr_Command_Iterator (Array_Base <T> & arr)
: array_ (arr),
curr_location_ (0)
{
} // end constructor
template <typename T>
Expr_Command_Iterator <T>::~Expr_Command_Iterator (void)
{
} // end destructor
template <typename T>
bool Expr_Command_Iterator <T>::is_done (void) const
{
return (curr_location_ >= array_.cur_size_);
} // end is_done
template <typename T>
void Expr_Command_Iterator <T>::advance (void)
{
curr_location_++;
} // end advance
template <typename T>
T & Expr_Command_Iterator <T>::operator * (void)
{
return array_.data_[curr_location_];
} // end operator *
template <typename T>
T * Expr_Command_Iterator <T>::operator -> (void)
{
return &(array_.data_[curr_location_]);
} // end operator ->