<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> typename
![]() |
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. |
[Bearbeiten] Usage
- In einer Klassen-Template oder Funktions-Template kann typename als Alternative zu den Templaten Klasse Typen deklarieren verwendet werden .Original:In a Klassen-Template or Funktions-Template, typename can be used as an alternative to Klasse to declare templated types.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Innerhalb eines Template-Definition kann typename verwendet, um zu erklären, dass ein abhängiger Name ein Typ sein .Original:Inside a template definition, typename can be used to declare that a dependent name is a type.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
template <typename T> void foo (const std::vector<T> &v) { // std::vector<T>::const_iterator is a dependent name, // so using it as a type requires the addition of the // typename keyword typename std::vector<T>::const_iterator it = v.begin(); }