Normally, I like to pass parameters by references to avoid copying objects, even parameters are pointers. But I saw some developers do the following. Is there any disadvantage by doing the following?
class student {};
class teacher {};
void test(std::shared_ptr<student> student_param, teacher *teacher_param)
{
// ...
}
int main()
{
std::shared_ptr<student> stdnt(new student);
std::shared_ptr<teacher> tchr(new teacher);
test(stdnt, tchr.get())
}