Skip to content

Commit 0239916

Browse files
mikeblomeColin Robertson
authored andcommitted
fixed c-language inline topic to remove semicolon per user bug (MicrosoftDocs#391)
* fixed c-language inline topic to remove semicolon per user bug * Update inline-functions.md Make it match the 2010 style, the only one that appears to be correct.
1 parent fb63c7c commit 0239916

1 file changed

Lines changed: 27 additions & 25 deletions

File tree

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Inline Functions | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "10/16/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-language"]
@@ -16,28 +16,30 @@ ms.author: "mblome"
1616
manager: "ghogen"
1717
---
1818
# Inline Functions
19-
**Microsoft Specific**
20-
21-
The `__inline` keyword tells the compiler to substitute the code within the function definition for every instance of a function call. However, substitution occurs only at the compiler's discretion. For example, the compiler does not inline a function if its address is taken or if it is too large to inline.
22-
23-
For a function to be considered as a candidate for inlining, it must use the new-style function definition.
24-
25-
Use this form to specify an inline function:
26-
27-
`__inline` *type*opt*function-definition*`;`
28-
29-
The use of inline functions generates faster code and can sometimes generate smaller code than the equivalent function call generates for the following reasons:
30-
31-
- It saves the time required to execute function calls.
32-
33-
- Small inline functions, perhaps three lines or less, create less code than the equivalent function call because the compiler doesn't generate code to handle arguments and a return value.
34-
35-
- Functions generated inline are subject to code optimizations not available to normal functions because the compiler does not perform interprocedural optimizations.
36-
37-
Functions using `__inline` should not be confused with inline assembler code. See [Inline Assembler](../c-language/inline-assembler-c.md) for more information.
38-
39-
**END Microsoft Specific**
40-
41-
## See Also
42-
[inline, __inline, \__forceinline](../cpp/inline-functions-cpp.md)
19+
20+
**Microsoft Specific**
21+
22+
The `__inline` keyword tells the compiler to substitute the code within the function definition for every instance of a function call. However, substitution occurs only at the compiler's discretion. For example, the compiler does not inline a function if its address is taken or if it is too large to inline.
23+
24+
For a function to be considered as a candidate for inlining, it must use the new-style function definition.
25+
26+
Use this form to specify an inline function:
27+
28+
> **__inline** *type*<sub>opt</sub> *function-definition*
29+
30+
The use of inline functions generates faster code and can sometimes generate smaller code than the equivalent function call generates for the following reasons:
31+
32+
- It saves the time required to execute function calls.
33+
34+
- Small inline functions, perhaps three lines or less, create less code than the equivalent function call because the compiler doesn't generate code to handle arguments and a return value.
35+
36+
- Functions generated inline are subject to code optimizations not available to normal functions because the compiler does not perform interprocedural optimizations.
37+
38+
Functions using `__inline` should not be confused with inline assembler code. See [Inline Assembler](../c-language/inline-assembler-c.md) for more information.
39+
40+
**END Microsoft Specific**
41+
42+
## See Also
43+
44+
[inline, __inline, \__forceinline](../cpp/inline-functions-cpp.md)
4345

0 commit comments

Comments
 (0)