In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:204:9: error: expected unqualified-id before 'this'
this->maxLoadFactor = that.maxLoadFactor;
^~~~
/in/hashtable.hpp:205:9: error: expected unqualified-id before 'this'
this->hash = that.hash;
^~~~
/in/hashtable.hpp:206:9: error: expected unqualified-id before 'this'
this->keyEqual = that.keyEqual;
^~~~
/in/hashtable.hpp:207:9: error: expected unqualified-id before 'this'
this->buckets = that.buckets;
^~~~
/in/hashtable.hpp:208:9: error: expected unqualified-id before 'this'
this->firstBucketIt = that.firstBucketIt;
^~~~
/in/hashtable.hpp: In copy constructor 'HashTable<Key, Value, Hash, KeyEqual>::HashTable(const HashTable<Key, Value, Hash, KeyEqual>&)':
/in/hashtable.hpp:203:9: error: expected identifier before 'this'
this->tableSize = that.tableSize;
^~~~
/in/hashtable.hpp:203:9: error: expected '{' before 'this'
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:211:5: error: expected ';' before 'HashTable'
HashTable &operator=(const HashTable &that) {
^~~~~~~~~
/in/hashtable.hpp:239:6: error: extra ';' [-Werror=pedantic]
};
^
/in/hashtable.hpp:241:15: error: expected class-name before '(' token
~HashTable() = default;
^
/in/hashtable.hpp:243:5: error: 'Iterator' does not name a type; did you mean 'perror'?
Iterator begin() {
^~~~~~~~
perror
/in/hashtable.hpp:250:5: error: 'Iterator' does not name a type; did you mean 'perror'?
Iterator end() {
^~~~~~~~
perror
/in/hashtable.hpp:260:25: error: 'Key' does not name a type
bool contains(const Key &key) {
^~~
/in/hashtable.hpp: In function 'bool contains(const int&)':
/in/hashtable.hpp:261:16: error: 'find' was not declared in this scope
return find(key) != end();
^~~~
/in/hashtable.hpp:261:16: note: suggested alternative:
In file included from /usr/include/c++/7/functional:64:0,
from /in/hashtable.hpp:4,
from /in/driver/main.cpp:5:
/usr/include/c++/7/bits/stl_algo.h:3899:5: note: 'std::find'
find(_InputIterator __first, _InputIterator __last,
^~~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp:261:29: error: 'end' was not declared in this scope
return find(key) != end();
^~~
/in/hashtable.hpp:261:29: note: suggested alternative:
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/range_access.h:107:37: note: 'std::end'
template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
^~~
In file included from /in/driver/main.cpp:5:0:
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:272:5: error: 'Iterator' does not name a type; did you mean 'perror'?
Iterator find(const Key &key) {
^~~~~~~~
perror
/in/hashtable.hpp:301:23: error: 'Iterator' does not name a type; did you mean 'perror'?
bool insert(const Iterator &it, const Key &key, const Value &value) {
^~~~~~~~
perror
/in/hashtable.hpp:301:43: error: 'Key' does not name a type
bool insert(const Iterator &it, const Key &key, const Value &value) {
^~~
/in/hashtable.hpp:301:59: error: 'Value' does not name a type
bool insert(const Iterator &it, const Key &key, const Value &value) {
^~~~~
/in/hashtable.hpp: In function 'bool insert(const int&, const int&, const int&)':
/in/hashtable.hpp:303:16: error: request for member 'endFlag' in 'it', which is of non-class type 'const int'
if (it.endFlag) {
^~~~~~~
/in/hashtable.hpp:304:34: error: 'hashKey' was not declared in this scope
size_t bucketIndex = hashKey(key);
^~~~~~~
/in/hashtable.hpp:305:28: error: 'buckets' was not declared in this scope
auto &bucket = buckets[bucketIndex];
^~~~~~~
/in/hashtable.hpp:305:28: note: suggested alternative: 'bucket'
auto &bucket = buckets[bucketIndex];
^~~~~~~
bucket
/in/hashtable.hpp:306:36: error: request for member 'listItBefore' in 'it', which is of non-class type 'const int'
bucket.insert_after(it.listItBefore, {key, value});
^~~~~~~~~~~~
/in/hashtable.hpp:307:15: error: 'tableSize' was not declared in this scope
++tableSize;
^~~~~~~~~
/in/hashtable.hpp:309:17: error: 'firstBucketIt' was not declared in this scope
if (firstBucketIt == buckets.end() || bucketIndex < (size_t)std::distance(buckets.begin(), firstBucketIt)) {
^~~~~~~~~~~~~
/in/hashtable.hpp:313:17: error: 'loadFactor' was not declared in this scope
if (loadFactor() > maxLoadFactor) {
^~~~~~~~~~
/in/hashtable.hpp:313:32: error: 'maxLoadFactor' was not declared in this scope
if (loadFactor() > maxLoadFactor) {
^~~~~~~~~~~~~
/in/hashtable.hpp:314:24: error: 'findMinimumBucketSize' was not declared in this scope
rehash(findMinimumBucketSize(buckets.size() * 2));
^~~~~~~~~~~~~~~~~~~~~
/in/hashtable.hpp:314:17: error: 'rehash' was not declared in this scope
rehash(findMinimumBucketSize(buckets.size() * 2));
^~~~~~
/in/hashtable.hpp:314:17: note: suggested alternative: 'rename'
rehash(findMinimumBucketSize(buckets.size() * 2));
^~~~~~
rename
/in/hashtable.hpp:320:30: error: request for member 'listItBefore' in 'it', which is of non-class type 'const int'
auto listIt = it.listItBefore;
^~~~~~~~~~~~
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:337:23: error: 'Key' does not name a type
bool insert(const Key &key, const Value &value) {
^~~
/in/hashtable.hpp:337:39: error: 'Value' does not name a type
bool insert(const Key &key, const Value &value) {
^~~~~
/in/hashtable.hpp: In function 'bool insert(const int&, const int&)':
/in/hashtable.hpp:339:9: error: 'Iterator' was not declared in this scope
Iterator it = find(key);
^~~~~~~~
/in/hashtable.hpp:339:9: note: suggested alternative: 'perror'
Iterator it = find(key);
^~~~~~~~
perror
/in/hashtable.hpp:341:23: error: 'it' was not declared in this scope
return insert(it, key, value);
^~
/in/hashtable.hpp:341:23: note: suggested alternative: 'int'
return insert(it, key, value);
^~
int
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:352:22: error: 'Key' does not name a type
bool erase(const Key &key) {
^~~
/in/hashtable.hpp: In function 'bool erase(const int&)':
/in/hashtable.hpp:354:9: error: 'Iterator' was not declared in this scope
Iterator it = find(key);
^~~~~~~~
/in/hashtable.hpp:354:9: note: suggested alternative: 'perror'
Iterator it = find(key);
^~~~~~~~
perror
/in/hashtable.hpp:356:13: error: 'it' was not declared in this scope
if (it.endFlag) {
^~
/in/hashtable.hpp:356:13: note: suggested alternative: 'int'
if (it.endFlag) {
^~
int
/in/hashtable.hpp:360:30: error: 'hashKey' was not declared in this scope
size_t bucketIndex = hashKey(key);
^~~~~~~
/in/hashtable.hpp:361:24: error: 'buckets' was not declared in this scope
auto &bucket = buckets[bucketIndex];
^~~~~~~
/in/hashtable.hpp:361:24: note: suggested alternative: 'bucket'
auto &bucket = buckets[bucketIndex];
^~~~~~~
bucket
/in/hashtable.hpp:363:28: error: 'it' was not declared in this scope
bucket.erase_after(it.listItBefore);
^~
/in/hashtable.hpp:363:28: note: suggested alternative: 'int'
bucket.erase_after(it.listItBefore);
^~
int
/in/hashtable.hpp:364:11: error: 'tableSize' was not declared in this scope
--tableSize;
^~~~~~~~~
/in/hashtable.hpp:366:31: error: 'firstBucketIt' was not declared in this scope
if (bucket.empty() && firstBucketIt == buckets.begin() + bucketIndex) {
^~~~~~~~~~~~~
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:387:5: error: 'Iterator' does not name a type; did you mean 'perror'?
Iterator erase(const Iterator &it) {
^~~~~~~~
perror
/in/hashtable.hpp:421:5: error: 'Value' does not name a type
Value &operator[](const Key &key) {
^~~~~
/in/hashtable.hpp: In function 'void rehash(size_t)':
/in/hashtable.hpp:460:22: error: 'findMinimumBucketSize' was not declared in this scope
bucketSize = findMinimumBucketSize(bucketSize);
^~~~~~~~~~~~~~~~~~~~~
/in/hashtable.hpp:461:27: error: 'buckets' was not declared in this scope
if (bucketSize == buckets.size()) return;
^~~~~~~
/in/hashtable.hpp:461:27: note: suggested alternative: 'bucketSize'
if (bucketSize == buckets.size()) return;
^~~~~~~
bucketSize
/in/hashtable.hpp:464:9: error: 'HashTableData' was not declared in this scope
HashTableData newBuckets(bucketSize);
^~~~~~~~~~~~~
/in/hashtable.hpp:464:9: note: suggested alternative: 'HashTable'
HashTableData newBuckets(bucketSize);
^~~~~~~~~~~~~
HashTable
/in/hashtable.hpp:466:29: error: 'buckets' was not declared in this scope
for (auto &bucket : buckets) {
^~~~~~~
/in/hashtable.hpp:466:29: note: suggested alternative: 'bucket'
for (auto &bucket : buckets) {
^~~~~~~
bucket
/in/hashtable.hpp:467:31: error: unable to deduce 'auto&&' from 'bucket'
for (auto &node : bucket) {
^~~~~~
/in/hashtable.hpp:468:41: error: 'hashKey' was not declared in this scope
size_t newBucketIndex = hashKey(node.first, bucketSize);
^~~~~~~
/in/hashtable.hpp:469:17: error: 'newBuckets' was not declared in this scope
newBuckets[newBucketIndex].push_front(std::move(node));
^~~~~~~~~~
/in/hashtable.hpp:469:17: note: suggested alternative: 'newBucketIndex'
newBuckets[newBucketIndex].push_front(std::move(node));
^~~~~~~~~~
newBucketIndex
/in/hashtable.hpp:473:9: error: 'buckets' was not declared in this scope
buckets = std::move(newBuckets);
^~~~~~~
/in/hashtable.hpp:473:9: note: suggested alternative: 'bucketSize'
buckets = std::move(newBuckets);
^~~~~~~
bucketSize
/in/hashtable.hpp:473:29: error: 'newBuckets' was not declared in this scope
buckets = std::move(newBuckets);
^~~~~~~~~~
/in/hashtable.hpp:475:9: error: 'firstBucketIt' was not declared in this scope
firstBucketIt = buckets.end();
^~~~~~~~~~~~~
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:487:19: error: non-member function 'size_t size()' cannot have cv-qualifier
size_t size() const { return tableSize; }
^~~~~
/in/hashtable.hpp: In function 'size_t size()':
/in/hashtable.hpp:487:34: error: 'tableSize' was not declared in this scope
size_t size() const { return tableSize; }
^~~~~~~~~
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:492:25: error: non-member function 'size_t bucketSize()' cannot have cv-qualifier
size_t bucketSize() const { return buckets.size(); }
^~~~~
/in/hashtable.hpp: In function 'size_t bucketSize()':
/in/hashtable.hpp:492:40: error: 'buckets' was not declared in this scope
size_t bucketSize() const { return buckets.size(); }
^~~~~~~
/in/hashtable.hpp:492:40: note: suggested alternative: 'bucketSize'
size_t bucketSize() const { return buckets.size(); }
^~~~~~~
bucketSize
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:497:25: error: non-member function 'double loadFactor()' cannot have cv-qualifier
double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
^~~~~
/in/hashtable.hpp: In function 'double loadFactor()':
/in/hashtable.hpp:497:49: error: 'tableSize' was not declared in this scope
double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
^~~~~~~~~
/in/hashtable.hpp:497:49: note: suggested alternative: 'bucketSize'
double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
^~~~~~~~~
bucketSize
/in/hashtable.hpp:497:70: error: 'buckets' was not declared in this scope
double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
^~~~~~~
/in/hashtable.hpp:497:70: note: suggested alternative: 'bucketSize'
double loadFactor() const { return (double) tableSize / (double) buckets.size(); }
^~~~~~~
bucketSize
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:502:31: error: non-member function 'double getMaxLoadFactor()' cannot have cv-qualifier
double getMaxLoadFactor() const { return maxLoadFactor; }
^~~~~
/in/hashtable.hpp: In function 'double getMaxLoadFactor()':
/in/hashtable.hpp:502:46: error: 'maxLoadFactor' was not declared in this scope
double getMaxLoadFactor() const { return maxLoadFactor; }
^~~~~~~~~~~~~
/in/hashtable.hpp:502:46: note: suggested alternative: 'getMaxLoadFactor'
double getMaxLoadFactor() const { return maxLoadFactor; }
^~~~~~~~~~~~~
getMaxLoadFactor
/in/hashtable.hpp: In function 'void setMaxLoadFactor(double)':
/in/hashtable.hpp:513:9: error: 'maxLoadFactor' was not declared in this scope
maxLoadFactor = loadFactor;
^~~~~~~~~~~~~
/in/hashtable.hpp:513:9: note: suggested alternative: 'loadFactor'
maxLoadFactor = loadFactor;
^~~~~~~~~~~~~
loadFactor
/in/hashtable.hpp:514:16: error: 'buckets' was not declared in this scope
rehash(buckets.size());
^~~~~~~
/in/hashtable.hpp:514:16: note: suggested alternative: 'bucketSize'
rehash(buckets.size());
^~~~~~~
bucketSize
/in/hashtable.hpp: At global scope:
/in/hashtable.hpp:517:1: error: expected declaration before '}' token
};
^
/in/hashtable.hpp: In function 'bool insert(const int&, const int&, const int&)':
/in/hashtable.hpp:325:5: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1plus: all warnings being treated as errors