Constant functions can't be used on constant referenced object?
<p>I'm not entirely sure how to describe my issue at all.</p>

<p>Basically I have a function that checks to see if my rectangle contains a different rectangle, however, when I attempt to use my functions such as <code>getX</code> and <code>getY</code> I am met with: <code>Error: the object has type qualifiers that are not compatible with the member function object type is: const Rectangle2D</code>.</p>

<p>My function is below.</p>

<pre><code>const bool Rectangle2D::contains(const Rectangle2D &amp;r) {
    const double x = r.getX();
    const double y = r.getY();
    const double width = r.getWidth();
    const double height = r.getHeight();
}
</code></pre>

<p>All of my <code>get</code> functions are constant, example:</p>

<pre><code>const double Rectangle2D::getX() {
    return x;
}
</code></pre>

<p>And in my class it the function is defined as <code>const bool contains(const Rectangle2D &amp;r)</code>.</p>

<p>If more information is needed let me know. I would appreciate it if someone could help me out or point me in the right direction.</p>
