File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ class Array
47
47
void assign (const size_t n, const Array<U,N> & values);
48
48
void push_back (const T & value);
49
49
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 ;
54
54
T * data ();
55
55
56
56
private:
@@ -59,7 +59,7 @@ class Array
59
59
};
60
60
61
61
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)
63
63
{
64
64
stream.print (" [" );
65
65
for (size_t i=0 ; i<array.size (); ++i)
Original file line number Diff line number Diff line change @@ -149,25 +149,25 @@ void Array<T, MAX_SIZE>::pop_back()
149
149
}
150
150
151
151
template <typename T, size_t MAX_SIZE>
152
- size_t Array<T, MAX_SIZE>::size()
152
+ size_t Array<T, MAX_SIZE>::size() const
153
153
{
154
154
return size_;
155
155
}
156
156
157
157
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
159
159
{
160
160
return MAX_SIZE;
161
161
}
162
162
163
163
template <typename T, size_t MAX_SIZE>
164
- bool Array<T, MAX_SIZE>::empty()
164
+ bool Array<T, MAX_SIZE>::empty() const
165
165
{
166
166
return size_ == 0 ;
167
167
}
168
168
169
169
template <typename T, size_t MAX_SIZE>
170
- bool Array<T, MAX_SIZE>::full()
170
+ bool Array<T, MAX_SIZE>::full() const
171
171
{
172
172
return size_ == MAX_SIZE;
173
173
}
You can’t perform that action at this time.
0 commit comments