I implemented an cpp file however it gives C4018 - signed/unsigned mismatch and C2995 - function template has already been defined error. Is there any solution of these?
Here is the error list of my cpp:
(178): warning C4018: '<' : signed/unsigned mismatch
(64): warning C4018: '>' : signed/unsigned mismatch
(83): warning C4018: '<' : signed/unsigned mismatch
(178): warning C4018: '<' : signed/unsigned mismatch
(48): error C2995: 'HashTable<HashedObj>::HashTable(const HashedObj &,int)' : function template has already been defined
(66): error C2995: 'void HashTable<HashedObj>::insert(const HashedObj &)' : function template has already been defined
(32) : see declaration of 'HashTable<HashedObj>::insert'
(86): error C2995: 'void HashTable<HashedObj>::rehash(void)' : function template has already been defined
(54) : see declaration of 'HashTable<HashedObj>::rehash'
(107): error C2995: 'int HashTable<HashedObj>::findPos(const HashedObj &) const' : function template has already been defined
(53) : see declaration of 'HashTable<HashedObj>::findPos'
(119): error C2995: 'void HashTable<HashedObj>::remove(const HashedObj &)' : function template has already been defined
(33) : see declaration of 'HashTable<HashedObj>::remove'
(133): error C2995: 'const HashedObj &HashTable<HashedObj>::find(const HashedObj &) const' : function template has already been defined
(29) : see declaration of 'HashTable<HashedObj>::find'
(144): error C2995: 'void HashTable<HashedObj>::makeEmpty(void)' : function template has already been defined
(31) : see declaration of 'HashTable<HashedObj>::makeEmpty'
(159): error C2995: 'const HashTable<HashedObj> &HashTable<HashedObj>::operator =(const HashTable<HashedObj> &)' : function template has already been defined
(35) : see declaration of 'HashTable<HashedObj>::operator ='
(169): error C2995: 'bool HashTable<HashedObj>::isActive(int) const' : function template has already been defined
(52) : see declaration of 'HashTable<HashedObj>::isActive'
(175): error C2084: function 'int hash(const std::string &,int)' already has a body
(178): warning C4018: '<' : signed/unsigned mismatch
(58) : see previous definition of 'hash'
The signed/unsigned warning often happens in a 'for' loop when the index variable is of a different integer type (often 'int') than the bounds for the 'for' loop (often 'size_t').
The template error can likely be explained in the code which defines the HashTable class template, which is not shown, above. Perhaps, you are redefining things?