The top-level const is ignored when an argument is initialized with an taxiing parameter.
Use constant references as much as possible, and ordinary references can limit the types of arguments that can be accepted and mislead callers.
3 Ways to manage array arguments:
- The array itself contains a closing tag
- Passing pointers to the elements of the array
- Defines a formal parameter that represents the size of an array
Functions of deformable parameters
If the argument type is the same, the Initializer_list template type is available, and the variable parameter template is used if the type is different.
The initialization list supports size () begin () end (), and copies and assignments do not copy elements, but are shared.
Returns an array pointer
typedef int ARRT[10];
Using ARRT=INT[10];
arrt* func (int i);
Declaring functions without type aliases
int (*func (int i)) [10];
Using the tail return type
Auto func (int i), int (*) [10];
Using Decltype
Const overload
The top-level const does not differentiate, so it cannot be overloaded
The underlying const can be overloaded, and a const object can only be passed to a const parameter, whereas a very high-level object compiler takes precedence over a very heavy version.
ASSERT (expr) ndebug
When it is true, do nothing; export the information at the time of the false and terminate the execution of the program.
Dependent on the state of the Ndebug preprocessing variable
Ndebug can also be used to write debug code
Several useful variables that are defined by the compiler
__FUNC__ the name of the currently debugged function const char Array
__file__ string literals for storing file names
__line__ integer literals that hold the current line number
__time__ string literals that store file compilation time
__date__ string literals that store file compilation dates
Basic/C + +----functions