I recently searched for the source code of Notepad ++ on GitHub, and met a method invocation method as follows:
Window::init(hInst, parent);
I looked for the function that I referenced and came across a Windowclass, but the function initwas marked virtualso that it was non-stationary. Thinking that I made a mistake, I checked the entire header to make sure there was no static overload init, and I made sure that there was no file Window.cpp. This is not true.
After you scroll through the source code for another 15 minutes, I handed over the git clonedrepo locally to open it in Visual Studio. The first thing I did was build only to make sure that this was not an accidental merger on behalf of the project developers - the assembly was successful.
The following steps I have taken:
I opened the file calling Window::initand clicked Go To Declarationon Window. This leads me to class Window.
I clicked Go To Declarationon a function init. He points me to the signature of the virtual method.
I copy and paste the file Window.hinto a completely new header and replace all links Windowwith Foo. When I type Foo::init, the compiler complains that "the reference to the non-static member must be relative to a specific object."
TL; DR:. - Notepad ++ , . - . .
2 , , . - ?