title: does an object lose its constness when an implicit conversion occurs?
body: <p>I have done a little experiment and I don't understand the output !</p>
  
  <pre><code>class C {
  public:
    operator int() const { std::cout &lt;&lt; "I'm const" &lt;&lt; std::endl;}
    operator int(){ std::cout &lt;&lt; "I'm not const" &lt;&lt; std::endl;}
  };
  
  void f(int){};
  
  int main()
  {
    f(C());
  }
  </code></pre>
  
  <p>Why does this output <code>"i'm not const"</code> ? Shouldn't the first cast of the C object, which is an rvalue and therefore const, be prioritary?</p>
  
  <p>Thanks ! :)</p>
  
  <p>Edit : If it can make the question more precise :</p>
  
  <p>In constrast :</p>
  
  <pre><code>void g(C const &amp;){ std::cout &lt;&lt; "I take a const" &lt;&lt; std::endl; };
  void g(C &amp;){ std::cout &lt;&lt; "I take a non const" &lt;&lt; std::endl; };
  </code></pre>
  
  <blockquote>
    <p>g(C()) outputs "I take a const".</p>
  </blockquote>