Friend function access the private members of class defined in static library
问题 I have a static library written in C++. I have also got the header files for the classes defined in the static library. Can I access the private members of the classes defined in the static library introducing a friend function in class declaration ? 回答1: You mean you want to change the headers that are shipped with the library? It's in no way guaranteed that adding friend declarations there will work. You might mess up the linking part, even if your compiler says it's ok. Also, if those