What are the learning points of C++
This article introduces the relevant knowledge of "what are the learning points of C++". In the operation of practical cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
16. Inline functions (inline) are actually similar to macros in implementation, expanding functions where inline functions appear to avoid function calls out of stack, such as stack, and improve efficiency. But the cost of inline functions is code growth. Inline functions are suitable for member functions and free functions. Functions implemented in a class are automatically inline functions. Inline must be defined on the implementation of the function, for example: inline int PlusOne (int) is invalid. The friend function is automatically changed into an inline function in the body of the class.
17. # include
# define DEBUG (X) cout