Hello!
This is my first time posting here, I hope I am doing so correctly, if not I firmly apologize! I simply am having a lot of trouble with my code and finally hit a breaking point. I have been working on this for hours, and googled heavily, and i think i understand what its saying but I have no idea how to fix it at all.
I am supposed to do code that makes a class template for arrays, and operator overload the information. But whenever I try to check and see if my operator+ overloading works, it says 'error C2679: binary '+' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)".
This is my operator+ overloading
(this is in tlist.cpp which has the declaration of the class template and the member functions to it)
TLIST<t_type> & operator+(const TLIST<t_type> & org);
(this is the member function of operator+)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
template <class t_type>
TLIST<t_type> & operator+(const TLIST<t_type> & org)
{
if (count < capacity)
{
DB[count++] = org;
}
else
{
Double_Size();
(*this) + org;
}
}
|
this is in the other .cpp file which has only the main
1 2
|
TLIST<char> Char_List, TempChar1, TempChar2; //default called
Char_List + 'W' + 'E' + 'L' + 'C' + 'O' + 'M' + 'E';
|
Could someone tell me what is making it say i cant put an int into the TLIST<int>? I dont know how to fix it, i thought i saw online using 'const' would fix it, but i used const, so now i am lost.
Thank you!