Skip to content

Commit a0884ef

Browse files
committed
Changed const in several places.
1 parent 53d0bc1 commit a0884ef

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Array.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class Array
4747
void assign(const size_t n, const Array<U,N> & values);
4848
void push_back(const T & value);
4949
void pop_back();
50-
size_t size();
51-
size_t max_size();
52-
bool empty();
53-
bool full();
50+
size_t size() const;
51+
size_t max_size() const;
52+
bool empty() const;
53+
bool full() const;
5454
T * data();
5555

5656
private:
@@ -59,7 +59,7 @@ class Array
5959
};
6060

6161
template <typename T, size_t MAX_SIZE>
62-
inline Print & operator <<(Print & stream, const Array<T,MAX_SIZE> & array)
62+
inline Print & operator <<(Print & stream, Array<T,MAX_SIZE> & array)
6363
{
6464
stream.print("[");
6565
for (size_t i=0; i<array.size(); ++i)

ArrayDefinitions.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,25 @@ void Array<T, MAX_SIZE>::pop_back()
149149
}
150150

151151
template <typename T, size_t MAX_SIZE>
152-
size_t Array<T, MAX_SIZE>::size()
152+
size_t Array<T, MAX_SIZE>::size() const
153153
{
154154
return size_;
155155
}
156156

157157
template <typename T, size_t MAX_SIZE>
158-
size_t Array<T, MAX_SIZE>::max_size()
158+
size_t Array<T, MAX_SIZE>::max_size() const
159159
{
160160
return MAX_SIZE;
161161
}
162162

163163
template <typename T, size_t MAX_SIZE>
164-
bool Array<T, MAX_SIZE>::empty()
164+
bool Array<T, MAX_SIZE>::empty() const
165165
{
166166
return size_ == 0;
167167
}
168168

169169
template <typename T, size_t MAX_SIZE>
170-
bool Array<T, MAX_SIZE>::full()
170+
bool Array<T, MAX_SIZE>::full() const
171171
{
172172
return size_ == MAX_SIZE;
173173
}

0 commit comments

Comments
 (0)