1. Try to use const instead of macro definition because there is no type check for macro definition.
2. for complex object types, you are advised to use const &'s type transfer parameters to avoid calling constructor and destructor and improve the efficiency.
3. Features of member functions being overloaded:
(1) the same range (in the same class );
(2) The function name is the same;
(3) parameters are different;
(4) virtual keywords are optional.
4. Overwrite ※hide
(1) different function scopes are not derived classes and basic classes.
(2) functions with the same name and different parameters, or functions with the same name and parameters are hidden if there is no virtual in the base class, and the base class has virtual as overwrite.
5. The default value of the parameter can only appear in the declaration of the function, but not in the definition body.
6. If the function has multiple parameters, the parameter can only be left one by one from the back to the front.
7. inline is a kind of "keyword used for implementation", rather than a kind of "keyword used for declaration". The member functions in the class declaration will automatically become inline functions.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service