A method can't be const if it returns a non-const reference. Either make that method non-const or make the reference const. This is basic C++, you know... I'm moving the thread to a proper forum.