// Compile with: g++ 325_326.cc ../chapter5/162/student_constr.cpp
//
//
#include <iostream>
#include "../chapter5/162/student_constr.h"
using namespace std;

void bla(Student s)
{
   cout << "Body of the bla function" << endl;
}


Student blaS(Student s) // C++11: better define move constructor
                        //        and move assignment operator
{
   cout << "Body of the blaS function" << endl;
   return s;
}

int main()
{
   Student s("First Last");
   cout << "This is the first output of the main function " << endl;

   s.set_no(100);
   s.set_year_of_studies(1);

   int year, no;

   year = s.get_year_of_studies();
   no = s.get_no();
   cout << "Year of studies is " << year
        << " for student with no " << no
        << " and name " << s.get_name() << endl;

 Student scopied(s);  // Student creation
//
//
// bla(s);
// blaS(s);

 scopied = blaS(s); // Temporary objects are destroyed at the end
                      // of the full expression they are part of

   cout << "Just exiting the main function ...." << endl;

   return 0;
}
