title: How to manage one to many relationship between objects? ( move related )
body: <p>First of all I wanna say that I am very new to CPP (I started with cpp11) :)
  Considering the following entities: Student(first name + last name) and Group (description + more students). 
  I created the following 2 classes in C++:</p>
  
  <pre><code>class Student
  {
  private:
      std::string firstName;
      std::string lastName;
      Student(const Student &amp;student);
      Student&amp; operator=(const Student &amp;student);
  public:
      Student():firstName(""), lastName("") { }
      Student(std::string firstName, std::string lastName):firstName(firstName), lastName(lastName) { }
      Student(const Student &amp;&amp;student):firstName(student.firstName), lastName(student.lastName) { }
      Student&amp; operator=(const Student &amp;&amp;student) { this-&gt;firstName=student.firstName; this-&gt;lastName=student.lastName; return *this; }
      std::string GetFirstName() const { return this-&gt;firstName; }
      std::string GetLastName() const { return this-&gt;lastName; }
  };
  
  
  class Group
  {
  private:
      std::string description;
      std::vector&lt;std::shared_ptr&lt;Student&gt;&gt; students;
      Group(const Group &amp;group);
      Group&amp; operator=(const Group &amp;group);
  public:
      explicit Group():description(""), students(std::vector&lt;std::shared_ptr&lt;Student&gt;&gt;()) { }
      explicit Group(std::string description) :description(description), students(std::vector&lt;std::shared_ptr&lt;Student&gt;&gt;()) { }
      void NewStudent(Student &amp;&amp;student) { students.push_back(std::make_shared&lt;Student&gt;(std::move(student))); }
      std::vector&lt;std::shared_ptr&lt;Student&gt;&gt; GetStudents() const { return students; }
  };
  </code></pre>
  
  <p>In main I have this:</p>
  
  <pre><code>Student s1("fn1","ln1");
  Student s2("fn2","ln2");
  //Student s3("fn3","ln3");
  Group cppGroup("C plus plus");
  cppGroup.NewStudent(std::move(s1));
  cppGroup.NewStudent(std::move(s2));
  cppGroup.NewStudent(Student("fn3", "ln3"));
  //cppGroup.NewStudent(s3);
  std::vector&lt;std::shared_ptr&lt;Student&gt;&gt; cppStudents=cppGroup.GetStudents();
  </code></pre>
  
  <p>My question is related to NewStudent method.
  In the first 2 cases the parameter is move(s) and in the third case is Student(...).
  My guess is that Student("fn3", "ln3") is the same as Student s3("fn3, "ln3") but if i pass s3 to the function it just won't compile with the following error: <em>cannot convert from Student to Student&amp;&amp;</em></p>
  
  <p>PS: I would appreciate if you helped me understand how to make the example I considered ideal.
  Thank you very much.</p>
  
  <p>LE: I think I understand what is happening, Visual Studio shows the following error: <em>cannot convert an lvalue to a rvalue</em> so  my guess is that if I pass to NewStudent s3 it doesn't know how to convert it to a rvalue but if i pass it Student("fn3", "ln3") if will call the move constructor.</p>