This article is about inline functions in C and C++. For inline expansion more generally, see Inline expansion.
Not to be confused with Inline assembler.
This article needs to be updated. The reason given is: Meaning of inline changed in C++ (https://en.cppreference.com/w/cpp/language/inline). Please help update this article to reflect recent events or newly available information.(April 2019)
In the C and C++ programming languages, an inline function is one qualified with the keyword inline; this serves two purposes:
It serves as a compiler directive that suggests (but does not require) that the compiler substitute the body of the function inline by performing inline expansion, i.e. by inserting the function code at the address of each function call, thereby saving the overhead of a function call. In this respect it is analogous to the register storage class specifier, which similarly provides an optimization hint.[1]
The second purpose of inline is to change linkage behavior; the details of this are complicated. This is necessary due to the C/C++ separate compilation + linkage model, specifically because the definition (body) of the function must be duplicated in all translation units where it is used, to allow inlining during compiling, which, if the function has external linkage, causes a collision during linking (it violates uniqueness of external symbols). C and C++ (and dialects such as GNU C and Visual C++) resolve this in different ways.[1]
^ abMeyers, Randy (July 1, 2002). "The New C: Inline Functions". {{cite journal}}: Cite journal requires |journal= (help)
In the C and C++ programming languages, an inlinefunction is one qualified with the keyword inline; this serves two purposes: It serves as a compiler...
inline expansion, or inlining, is a manual or compiler optimization that replaces a function call site with the body of the called function. Inline expansion...
Inline citation (here meaning "within a line of text") Inline engine Inline hockey Inline skating Inline assembler Inline expansion Inlinefunction in...
original function call, similar to an inlinefunction. Unlike an inlinefunction, the compiler has an intimate knowledge of an intrinsic function and can...
programming language that prescribes that classes/structs and non-inlinefunctions cannot have more than one definition in the entire program and template...
Inline caching is an optimization technique employed by some language runtimes, and first developed for Smalltalk. The goal of inline caching is to speed...
In computer programming, an inline assembler is a feature of some compilers that allows low-level code written in assembly language to be embedded within...
designed mainly for source editing, and performs syntax highlighting and inlinefunction reference for many different languages. There is a standalone .exe...
likelihood function (often simply called the likelihood) is the joint probability mass (or probability density) of observed data viewed as a function of the...
traditionally known as the theory of functions of a complex variable, is the branch of mathematical analysis that investigates functions of complex numbers. It is...
the beta function, also called the Euler integral of the first kind, is a special function that is closely related to the gamma function and to binomial...
compiler in this matter by making additional use of static and/or inlinefunctions and enabling the use of link-time optimization. int foo (int iX, int...
be confused with closures and inlinefunctions. The concepts are related because a reference to a closure/inlinefunction must be captured in a delegate...
<complex.h> Improved compatibility with several C++ features, including inlinefunctions, single-line comments with //, mixing declarations and code, and universal...
In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all...
clarity */ long int quot; long int rem; } ldiv_t; /* Euclidean division */ inline ldiv_t ldivE(long numer, long denom) { /* The C99 and C++11 languages define...
new features: Inlinefunction expressions Anonymous functions can be created in an expression context. For example, the expression function($a as xs:double...