title: about c++ conversion : no known conversion for argument 1 from ‘[some_class]' to ‘[some_class]&’
body: <p>I'm working on C++, and had an error that I didn't know the exact reason. I've found the solution, but still want to know why. </p>
  
  <pre><code>    class Base
      {
          public:
                 void something(Base&amp; b){}
      };
  
      int main()
      {
          Base b;
          b.something(Base());
          return 0;           
      }
  </code></pre>
  
  <p>when I compile the code, I got this following error :</p>
  
  <pre><code>abc.cpp:12:20: error: no matching function for call to ‘Base::something(Base)’
  abc.cpp:12:20: note: candidate is:
  abc.cpp:6:7: note: void Base::something(Base&amp;)
  abc.cpp:6:7: note:   no known conversion for argument 1 from ‘Base’ to ‘Base&amp;’
  </code></pre>
  
  <p>but when I replaced b.something(Base()) into</p>
  
  <pre><code>Base c;
  b.something(c);
  </code></pre>
  
  <p>the error is gone, I'm wondering why??? aren't they have the same type? It only matters how I write it, but the meaning should be the same???</p>
  
  <p>Thanks Guys!</p>