pass by reference to const replace pass by value(45)

当用类去传递的时候遇见这么一个编译消耗。

Class Person {std::string str1, std::string str2;};
Class Student : public Person {std::string str1, std::string str2;};

//函数 validateStudent(Student s);
//分析:Student一次构造,成员对象有两个构造;父类一个构造,父类成员对象两个构造
要调用6次构造函数.大大的加大负担.

//解决方案:
validateStudent(const Student& s);一次不需要