Jednoduché názvy typu
Jednoduchý typ název je název jednoduchého typu.Typ, který není na ukazatel, referenční pole nebo ukazatel funkce.
class-name
[ :: ] nested-name-specifier type-name
[ :: ] nested-name-specifier template template-id
char
wchar_t
bool
short
int
long
signed
unsigned
float
double
void
auto
decltype ( expression )
Poznámky
Jednoduchý typ názvu může kvalifikován vnořené název specifikátor, určující obor názvů nebo obsahující třídu.
int // simple type name
unsigned int // combination of simple type names
MyClass // a class type
class MyClass // class is optional when using the type name
struct MyStruct // the keyword struct is optional in C++
enum MyEnum // the keyword enum is optional in C++
::MyClass // type name at global scope
Outer::Inner // nested type name
::Outer::Inner // nested type names with global scope operator
MyTemplate<int> // a class template
Outer::Inner<int> // an inner class template
Outer<char>::Inner<int> // an inner class template of a template class
::template MyTemplate<int> // using the template keyword
typename MyClass // the typename keyword (only in a template definition)
Následující tabulka uvádí názvy jednoduchý typ použití společně.
Zadejte název kombinace
Type |
Mohou objevit |
Komentáře |
---|---|---|
int |
longnebo short, ale ne obojí |
Typ int znamená typu long int. |
long |
intnebodouble |
Typ long znamená typu long int. |
short |
int |
Typ short znamená typu short int. |
signed |
char, short, int nebo long |
Type signed implies signed int.Většina významný bit objekty typu signed char a je je znaménkový bit pole podepsané nedílnou typů. |
unsigned |
char, short, int nebo long |
Type unsigned implies unsigned int.Většina významný bit objekty typu unsigned char a bit pole typů nepodepsané nedílnou není považován za znaménkový. |