Inline function cannot be used in the for loop.

Source: Internet
Author: User

Inline function cannot be used in the for loop.

The role of the inline function inherits the advantages of macro definition, does not have parameter pressure stacks, code generation and other operations, and does not check compilation rules;

 

In addition, it should be noted that inline functions are generally used only when the function content is very simple. This is because the code of inline functions is expanded wherever it is called. If the function is too complex, the consequence of code expansion is likely to be greater than the benefits of efficiency improvement. The most important use of inline functions is for class access functions. Cause 1: inline is actually a macro replacement, that is, copying the binary code of the function directly to the called place. Therefore, inline code should not be redirected. The loop structure cannot avoid conditional jump, so the Code with loops cannot be inline; cause 2: The inline is to copy the code to the specified position, and a large amount of code will be copied in the loop; this can be considered by default that the inline function cannot be in the for loop. Http://bbs.csdn.net/topics/340149836

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.