title: C++ calls default constructor instead of copy constructor
body: <p>I'm trying to write a program for my Arduino, but I don't understand something that's happening when passing an <code>Item</code> object to another <code>Holder</code> object. I've constructed a simple example:</p>
  
  <pre><code>class Item {
    public:
      int property;
  
      Item() {
        Serial.println("parameterless constructor called");
        this-&gt;property = 2;
      }
  
      Item(int property) {
        this-&gt;property = property;
        Serial.println("right constructor called");
      }
  };
  
  class Holder {
    public:
      Item someitem;
  
      Holder(Item&amp; someitem) {
        this-&gt;someitem = someitem;
      }
  };
  
  void setup() {
    Serial.begin(9600);
  
    Item someitem = Item(1);
    Serial.println(someitem.property);
  
    Holder hold = Holder(someitem);
    Serial.println(hold.someitem.property);
  }
  
  void loop() {
  
  }
  </code></pre>
  
  <p>The output on the console is:</p>
  
  <pre><code>right constructor called
  1
  parameterless constructor called
  1
  </code></pre>
  
  <p>I don't understand why the parameterless constructor is called in the first place (I'm not creating a new object to my understanding), and also why it does neither change the current object nor makes a new one. Leaving out the parameterless constructor is prevented by the compiler.</p>