src/Stack.h:132: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:132: error: passing ‘const Stack<int>’ as ‘this’ argument of ‘unsignedint Stack<T>::getSize() [with T = int]’ discards qualifiers
src/main.cpp:24: instantiated from here
src/Stack.h:135: error: assignment of data-member ‘Stack<int>::cursor’ in read-only structure
src/Stack.h:136: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:136: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:138: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:139: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:139: error: request for member ‘data’ in ‘((const Stack<int>*)this)->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
src/Stack.h:140: error: request for member ‘prev’ in ‘((const Stack<int>*)this)->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
src/Stack.h:141: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:141: error: base operand of ‘->’ has non-pointer type ‘const Stack<int>’
src/Stack.h:132: error: passing ‘const Stack<int>’ as ‘this’ argument of ‘unsignedint Stack<T>::getSize() [with T = int]’ discards qualifiers
src/main.cpp:24: instantiated from here
src/Stack.h:132: error: passing ‘const Stack<int>’ as ‘this’ argument of ‘unsignedint Stack<T>::getSize() [with T = int]’ discards qualifiers
src/main.cpp:24: instantiated from here
src/Stack.h:135: error: assignment of data-member ‘Stack<int>::cursor’ in read-only structure
src/Stack.h:136: error: assignment of data-member ‘Stack<int>::cursor’ in read-only structure
src/Stack.h:138: error: passing ‘const Stack<int>’ as ‘this’ argument of ‘unsignedint Stack<T>::getSize() [with T = int]’ discards qualifiers
src/main.cpp:24: instantiated from here
src/Stack.h:138: warning: comparison between signed and unsigned integer expressions
src/Stack.h:139: error: request for member ‘data’ in ‘rhs->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
src/Stack.h:139: error: request for member ‘data’ in ‘((const Stack<int>*)this)->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
src/Stack.h:140: error: request for member ‘prev’ in ‘((const Stack<int>*)this)->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
src/Stack.h:141: error: request for member ‘prev’ in ‘rhs->Stack<int>::cursor’, which is of non-class type ‘Node<int>* const’
lines 135/136, rhs and this are const, so you can't modify cursor.
for 139-141, you probably can't access the data because you could possibly modify it (and const functions aren't allowed to)
Can I see main.cpp and probably Stack's constructor?
Line 132: this and rhs are const, but getSize() requires that the this parameter be non-const. Make getSize() a const function.
Line 135: const function is attempting to change the value of member variables.
Line 136: Attempting to change the value of member variables of a constant object.
Line 139: cursor is a pointer, not an object. Use the -> operator to access its members.
Lines 140 and 141: Again trying to change values of member variables of constant objects.
Obviously I don't have * and -> down solid yet. Anyhow it works great now that I got that cleared up and I got the const issue fixed. Thanks for the comments.