#include <iostream> #include <vector> #include <string> class Doctor; class Patient { friend void Doctor::MeetPatients(); public: void MeetDoctors(); private: std::string mName; std::vector<Doctor*> mDoctors; }; class Doctor { friend void Patient::MeetDoctors(); public: void MeetPatients(); private: std::string mName; std::vector<Patient*> mPatients; }; void Doctor::MeetPatients() { for (auto& patient : mPatients) { std::cout << "Meet patient : " << patient->mName << '\n'; // 여기 mName 접근이 안되유 } } void Patient::MeetDoctors() { for (const auto& doc : mDoctors) { std::cout << "Meet doctor : " << doc->mName << '\n'; // 여기는 잘 되는데 왜 위는 안되는거? } }


저기 주석 단 부분 friend 함수로 지정 해줬는데도 접근이 안된다고 에러 떠