[fixed in 1.8 & 1.7.4]list::Iterator compile bug in 1.7.3?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
wqking
Posts: 11
Joined: Wed Nov 14, 2012 9:46 am

[fixed in 1.8 & 1.7.4]list::Iterator compile bug in 1.7.3?

Post by wqking »

Code: Select all

 
    class Iterator
    {
        Iterator& operator +=(s32 num)
        {
            if(num > 0)
            {
                while (num-- && this->Current != 0) ++(*this);
            }
            else
            {
                while(num++ && this->Current != 0) --(*this);
            }
            return *this;
        }
 
        Iterator& operator -=(s32 num) const { return (*this)+=(-num); }
    };
 
 
Above is a snippet of list::Iterator.
Note the -= operator is a const operator, but it invokes the non-const += and failed compile in VC.
There is no other overloading for +=

Is this a bug? Did it fix in 1.8.0?
http://www.cpgf.org/
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.3 was released. Now supports Irrlicht 3D engine v1.8 in script binding.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: irr::list::Iterator compile bug in 1.7.3?

Post by CuteAlien »

Two times yes - it is a bug and it is fixed in Irrlicht 1.8.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [fixed in 1.8]irr::list::Iterator compile bug in 1.7.3?

Post by hybrid »

'I guess it's even fixed for 1.7.4!?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [fixed in 1.8]irr::list::Iterator compile bug in 1.7.3?

Post by CuteAlien »

No, it's not. I suspect maybe because it would change the interface? Or simply someone was lazy? Don't know right now ... is changing const ok for minor library versions or will that already mess up linking? I wouldn't expect so.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [fixed in 1.8]irr::list::Iterator compile bug in 1.7.3?

Post by hybrid »

Well, this method wouldn't link anyway, so fixing should be ok.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [fixed in 1.8]irr::list::Iterator compile bug in 1.7.3?

Post by CuteAlien »

Ok, I've backported it to 1.7
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply