Hey would anyone be able to translate this to English for me?
1 2 3 4 5 6 7 8
In file included from VectorBag.h:36:0,
from proj2.cpp:28:
VectorBag.cpp: In instantiation of ‘bool VectorBag<ItemType>::remove(const ItemType&) [with ItemType = std::basic_string<char>]’:
proj2.cpp:117:40: required from ‘void bagTester(VectorBag<ItemType>&) [with ItemType = std::basic_string<char>]’
proj2.cpp:44:17: required from here
VectorBag.cpp:26:13: error: passing ‘const std::basic_string<char>’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ discards qualifiers [-fpermissive]
anEntry = items[items.size()];
^
if you need to take a look at the text file itself, let me know so i can add it (it's a little long so i thought i might try to keep it easier on the eye)
Basically, you are passing a constant reference to your 'remove' function, and then assigning it to a value, which requires discarding the cv-qualifiers of the object. If you need to assign, either pass by value or make a copy.