title: Const Functions and Interfaces in C++
body: <p>I'll use the following (trivial) interface as an example:</p>
  
  <pre><code>struct IObject
  {
    virtual ~IObject() {}
  
    virtual std::string GetName() const = 0;
    virtual void ChangeState() = 0;
  };
  </code></pre>
  
  <p>Logic dictates that <code>GetName</code> should be a <code>const</code> member function while <code>ChangeState</code> shouldn't.</p>
  
  <p>All code that I've seen so far doesn't follow this logic, though. That is, <code>GetName</code> in the example above wouldn't be marked as a <code>const</code> member function.</p>
  
  <p>Is this laziness/carelessness or is there a legitimate reason for this? What are the major cons of me forcing my clients to implement <code>const</code> member functions when they are logically called for?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> Thanks for your responses everyone. I think it's pretty much unanimous: laziness/ignorance is the reason for what I'm seeing.</p>