Namensräume
Varianten
Aktionen

inline specifier

Aus cppreference.com
< cpp‎ | language

 
 
Sprache C++
Allgemeine Themen
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Flusskontrolle
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bedingte Ausführung Aussagen
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iterationsanweisungen
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gehe Aussagen
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktion Erklärung
Lambda-Funktion Erklärung
Funktions-Template
inline-Spezifizierer
Exception-Spezifikationen (veraltet)
noexcept Spezifizierer (C++11)
Ausnahmen
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Specifiers
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv Planer
Lagerdauer Planer
constexpr Spezifizierer (C++11)
auto Spezifizierer (C++11)
alignas Spezifizierer (C++11)
Initialisierung
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literale
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressions
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
alternative Darstellungen
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
Typ Aliasdeklaration (C++11)
Attribute (C++11)
Wirft
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
impliziten Konvertierungen
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-Stil und funktionale Besetzung
Speicherzuweisung
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Class-spezifische Funktion Eigenschaften
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
explizit (C++11)
statisch
Besondere Member-Funktionen
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Templates
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Klassen-Template
Funktions-Template
Template-Spezialisierung
Parameter Packs (C++11)
Verschiedenes
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Inline Montage
 

[Bearbeiten] Syntax

inline function_declaration

[Bearbeiten] Beschreibung

Das Schlüsselwort inline ist ein Hinweis für den Compiler, eine Optimierung vorzunehmen. Der Compiler kann diese Anforderung jedoch ignorieren.
Original:
The inline keyword is a hint given to the compiler to perform an optimization. The compiler has the freedom to ignore this request.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Wenn der Compiler eine Funktion als inline implementiert, ersetzt er jeden Aufruf dieser Funktion durch den eigentlichen Code (ohne einen Funktionsauruf) .
Original:
If the compiler inlines the function, it replaces every call of that function with the actual body (without generating a call).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dies vermeidet zusätzlichen Overhead durch den Aufruf der Funktion (Platzierung von Daten auf dem Stack und Abrufen des Ergebnisses), aber es kann zu größeren Binaries führen, da der Funktionscode eventuell mehrfach wiederholt werden muss.
Original:
This avoids extra overhead created by the function call (placing data on stack and retrieving the result) but it may result in a larger executable as the code for the function has to be repeated multiple times.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Das Ergebnis ist ähnlich funktionsähnlichen Makros
Original:
The result is similar to funktionsähnlichen Makros
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Der Funktionscode muss in der aktuellen Übersetzungseinheit verfügbar sein.
Original:
The function body must be visible in the current translation unit.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Methoden, die innerhalb der Klasse definiert werden, werden implizit als inline deklariert.
Original:
Class methods defined inside the class body are implicitly declared inline.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

inline int sum(int a, int b) 
{
    return (a + b);
}
 
int c = sum(1, 4);
// if the compiler inlines the function the compiled code will be the same as writing
int c = 1 + 4;