Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / A strange const usage (C++) Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Marmakoide

April 18, 2005, 06:37 AM

I was reading a code, and I see

  1.  
  2. LinearTransformation3d invert() const;
  3.  


What is the difference with :
  1.  
  2. LinearTransformation3d invert();
  3.  

 
mentalcalculator

April 18, 2005, 07:45 AM

invert() must belong to a class, otherwise a const modifier is not allowed. The difference is that a const method won't change the this object, that is, after calling that method on an object the object will remain exactly the same as it was beforing calling that method.

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.