<div class="t-tr-text">C + + keywords:<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">C++ keywords:</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> class
Aus cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
Usage
- Deklaration einer Klasse
- In einer Klassen-Template oder Funktions-Template,
classkönnen als Alternative zu den Typ typename Vorlagenparametern einzuführen verwendet werden .Original:In a Klassen-Template or Funktions-Template,classcan be used as an alternative to typename to introduce type template parameters.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn eine Funktion oder eine Variable existiert im Umfang mit dem Namen identisch mit dem Namen einer Klasse-Typ, kann
classdem Namen Begriffsklärung vorangestellt werden, was zu einer erarbeitet TypspezifiziererOriginal:If a function or a variable exists in scope with the name identical to the name of a class type,classcan be prepended to the name for disambiguation, resulting in an elaborated type specifierThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Beispiel
class Foo; // forward declaration of a class
class Bar { // definition of a class
public:
Bar(int i) : m_i(i) {}
private:
int m_i;
};
template <class T> // template argument
void qux() {
T t;
}
int main()
{
Bar Bar(1);
class Bar Bar2(2); // elaborated type
}