Namespace aliases
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Alias dello spazio dei nomi consentono al programmatore di definire un nome alternativo per uno spazio dei nomi.
Original:
Namespace aliases allow the programmer to define an alternate name for a namespace.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Essi sono comunemente utilizzati come una comoda scorciatoia per gli spazi dei nomi lunghi o profondamente nidificata.
Original:
They are commonly used as a convenient shortcut for long or deeply-nested namespaces.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Sintassi
namespace alias_name = ns_name; | (1) | ||||||||
namespace alias_name = :: ns_name; | (2) | ||||||||
namespace alias_name = nested_name:: ns_name; | (3) | ||||||||
[modifica]Spiegazione
Il nuovo alias alias_name fornisce un metodo alternativo per accedere ns_name.
Original:
The new alias alias_name provides an alternate method of accessing ns_name.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
alias_name deve essere un nome non utilizzato in precedenza. alias_name è valido per la durata di applicazione in cui viene introdotta.
Original:
alias_name must be a name not previously used. alias_name is valid for the duration of the scope in which it is introduced.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Esempio
#include <iostream> namespace foo {namespace bar {namespace baz {int qux =42;}}} namespace fbz = foo::bar::baz; int main(){std::cout<< fbz::qux<<'\n';}
Output:
42
[modifica]Vedi anche
namespace dichiarazione | identifica uno spazio dei nomi Original: identifies a namespace The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |