Commit 960fb926 authored by Kenton Varda's avatar Kenton Varda

Map::size() and Map::capacity() should be const.

parent 82e680f3
...@@ -44,8 +44,8 @@ public: ...@@ -44,8 +44,8 @@ public:
void reserve(size_t size); void reserve(size_t size);
// Pre-allocates space for a map of the given size. // Pre-allocates space for a map of the given size.
size_t size(); size_t size() const;
size_t capacity(); size_t capacity() const;
void clear(); void clear();
struct Entry { struct Entry {
...@@ -136,8 +136,8 @@ public: ...@@ -136,8 +136,8 @@ public:
void reserve(size_t size); void reserve(size_t size);
// Pre-allocates space for a map of the given size. // Pre-allocates space for a map of the given size.
size_t size(); size_t size() const;
size_t capacity(); size_t capacity() const;
void clear(); void clear();
struct Entry { struct Entry {
...@@ -281,11 +281,11 @@ void HashMap<Key, Value>::reserve(size_t size) { ...@@ -281,11 +281,11 @@ void HashMap<Key, Value>::reserve(size_t size) {
} }
template <typename Key, typename Value> template <typename Key, typename Value>
size_t HashMap<Key, Value>::size() { size_t HashMap<Key, Value>::size() const {
return table.size(); return table.size();
} }
template <typename Key, typename Value> template <typename Key, typename Value>
size_t HashMap<Key, Value>::capacity() { size_t HashMap<Key, Value>::capacity() const {
return table.capacity(); return table.capacity();
} }
template <typename Key, typename Value> template <typename Key, typename Value>
...@@ -373,11 +373,11 @@ void TreeMap<Key, Value>::reserve(size_t size) { ...@@ -373,11 +373,11 @@ void TreeMap<Key, Value>::reserve(size_t size) {
} }
template <typename Key, typename Value> template <typename Key, typename Value>
size_t TreeMap<Key, Value>::size() { size_t TreeMap<Key, Value>::size() const {
return table.size(); return table.size();
} }
template <typename Key, typename Value> template <typename Key, typename Value>
size_t TreeMap<Key, Value>::capacity() { size_t TreeMap<Key, Value>::capacity() const {
return table.capacity(); return table.capacity();
} }
template <typename Key, typename Value> template <typename Key, typename Value>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment