C + + pseudo function:
The so-called pseudo function. This means that it is not a real function, but rather a class or a struct.
<span style= "FONT-SIZE:18PX;" > #include <iostream>void say_hello () { std::cout << "Hello world!" << Std::endl;} Class Hello{public: void Operator () () { std::cout << "Hello cpp!" << Std::endl; } overloaded operator ();}; int main () { Say_hello (); Hello p; P (); return 0;} </span>
Calls like Say_hello () in code are the function calls we use frequently. And we use Hello to define the p.
and then P (), which is what we call pseudo-functions. What are the advantages or advantages of pseudo-functions?
its strength lies in its ability to pass on. As defined by Hello, it is like a variable. Convenient.
It can also be called by other classes and members. Ordinary functions that we normally write can only rely on global variables.
c/c++:c++ pseudo function