Virtual methods create problems, not compiling

Hello guys,i made a program which manages graphs and works fine for now.

I'm extending the class "LIST" that is used inside my graph class.

So i made virtual methods for list class since i need new implementations.

Making some method virtual creates this error while compiling:

[Error] assignment of read-only member ...


Now, since i really don't get how to analyze this problem, i uploaded the full code in a zip file.

The idea is simple, and please note that this code works perfectly without using VIRTUAL methods (The one which make problems are operator= and set() for list class, just make them non virtual and code works again. These methods are not called for my graph implementation)

I KNOW IT'S SO BORING to read full code and trying to compile it but really i can't explain better this error.

Furthermore, i have to use Dev C++ (Orwell) for this, so i think my compiler is just not good as it should.

Please, if you can, i would really appreciate your help.

Full Code here (ZIP), it contains the full material, for lists and for graphs, everything works, but not graphs (with virtual methods).
Just compile main.cpp and you are ok to go:


Sorry for this mess. And still thanks
Last edited on
I KNOW IT'S SO BORING to read full code and trying to compile it but really i can't explain better this error.

I know it's boring to reduce code to the smallest compilable code snippet that reproduces the issue you're having, but doing so will often result in you finding the cause of the problem you're having and if it doesn't it makes it far more likely someone will be willing to respond to you.
Topic archived. No new replies allowed.