Hey I've tried to look at many examples but I just can't seem to get it. I'm trying to add 2 vectors and their components using the '+' operator. Here is my code:
//Errors:
Error 2 error C2804: binary 'operator +' has too many parameters 17
Error 3 error C2784: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_iterator<_Elem,_Traits,_Alloc>' from 'Vector' d:\lectures\530_computing2\assignment1\assignment1\encapsulate.cpp 34
Error 4 error C2784: 'std::_String_const_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_const_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_const_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' from 'Vector' d:\lectures\530_computing2\assignment1\assignment1\encapsulate.cpp 34
Error 5 error C2784: 'std::reverse_iterator<_RanIt> std::operator +(_Diff,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'Vector' d:\lectures\530_computing2\assignment1\assignment1\encapsulate.cpp 34
Error 6 error C2784: 'std::_Revranit<_RanIt,_Base> std::operator +(_Diff,const std::_Revranit<_RanIt,_Base> &)' : could not deduce template argument for 'const std::_Revranit<_RanIt,_Base> &' from 'Vector' d:\lectures\530_computing2\assignment1\assignment1\encapsulate.cpp 34
Error 7 error C2676: binary '+' : 'Vector' does not define this operator or a conversion to a type acceptable to the predefined operator d:\lectures\530_computing2\assignment1\assignment1\encapsulate.cpp 34