So I'm doing a school assignment that involves testing array classes. When I compiled with g++, I got these errors:
test_array.cpp: In member function ‘void Test_array::test_push_back()’:
test_array.cpp:9: error: void value not ignored as it ought to be
test_array.cpp: In member function ‘void Test_array::test_pop_back()’:
test_array.cpp:33: error: void value not ignored as it ought to be
test_array.cpp:41: error: argument of type ‘unsigned int (Array<int>::)()const’ does not match ‘int’
test_array.cpp:43: error: no matching function for call to ‘Array<int>::pop_back(int&)’
array.hpp:19: note: candidates are: void Array<generic>::pop_back() [with generic = int]
test_array.cpp:49: error: no matching function for call to ‘Array<int>::pop_back(int)’
array.hpp:19: note: candidates are: void Array<generic>::pop_back() [with generic = int]
Here are the lines that are before and after the errors
Line 7: Array<int>a;
Line 8: a.push_back (2)
Line 9: CPPUNIT_ASSERT(a.size()==0);
Line 10: CPPUNIT_ASSERT (a.max_size()== 20);
Lines 8 and 32: Missing semicolons.
Line 41: Missing empty parameter list ("()").
Line 43 and 49: Your pop_back() doesn't take any parameters. Don't you find it humiliating that other people are telling you how to use your own interfaces?