Re: [Plib-devel] PLIB developers needed.
Brought to you by:
sjbaker
From: Curtis L. O. <cu...@me...> - 2000-08-10 18:49:30
|
I didn't see that anyone replied to this so my apologies if I'm duplicating what someone else wrote. Steve Baker writes: > The 'P' in PLIB stands for "Portability" - and the rest is just a "LIBrary"! > > ...which reminds me... :-) > > I tried to compile PLIB on an SGI machine at work - and your > 'const-ification' of the clock routine stopped it from compiling on > the IRIX compiler. > > You had: > > class ulClock > { > ... > public: > ... > int getSomething () const { return something ; } > ... > } ; > > The 'const' seemed to do *bad* things to the SGI compiler. > > Could you remind me what exactly a 'const' right there actually *does*? As best as I can tell, this indicates to the compiler that a call to foo->getSomething() does not modify foo in anyway. So if you had a const instance of your class such as: const ulClock foo; Then calling foo.getSomething() is legal. It's all part of maintaining const consistancy. > ...and then remove them anyway! Const is pretty handy if used correctly ... :-) Regards, Curt. -- Curtis Olson Human Factors Research Lab Flight Gear Project Twin Cities cu...@hf... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |