Hoo-my. Doesn't look like it likes that, huh? You're going to have to remove the const from setNext to make it work.
Haha... didn't think of that. Of course, if it assigns the variable to the class member function which isn't const, of course the set function can't take a const pointer since the class can modify it later.
Yes, that's my thoughts too - and I made the same mistake. I just want to have the line of the error clarified.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
No, the setNext musn't take a pointer to const (const T*), because you can't demote to non-const w/o a cast (a bad cast).
You can take a const pointer (T* const), sure, but it doesn't really help.
Originally Posted by Adak
io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
Originally Posted by Salem
You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.
Outside of your DOS world, your header file is meaningless.