zoukankan      html  css  js  c++  java
  • Type

    Type

    ###Type Classification The C++ type system consists of the following types: * fundamental types (see also [`std::is_fundamental`](http://en.cppreference.com/w/cpp/types/is_fundamental)) * void * `std::nullptr_t` * arthmetic type * floating-point types(`float`,`double`,`long double`) * integral types * `bool` * character types * narrow character types(`char`,`sign char`,`unsigned char`) * wide character types(`char16_t`,`char32_t`,`wchar_t`) * signed integal types(`short int`,`int`,`long int`,`long long int`) * unsigned integal type(`unsigned short int`,`unsigned int`,`unsigned long int`,`unsigned long long int`) * compound types(see also[`std::is_compound`](http://en.cppreference.com/w/cpp/types/is_compound)) * reference types: * lvalue reference types * rvalue reference types * pointer types: * pointer to object types * pointer to function types * pointer to member types: * pointer to data member * pointer to member function * array types * function types * enumeration types * class types: * non-union types * union types

    For every type other than reference and function,the system support three additional cv-qualified version of that types(const,volatile,const volatile)

    ###Static type The type of expression that results from the compiler-time analysis of the program is known as the *static type* of the expression. The static type does not change while the program is executing. ###Dynamic type If some [`glvaue expression`](http://en.cppreference.com/w/cpp/language/value_category) refers to a polymorphic object, the type of its most derived object is known as the dynamic types. ```cpp // given struct B { virtual ~B() {} }; // polymorphic type struct D : B {}; // polymorphic type D d; // most derived object B* ptr = &d; // the static type of (*ptr) is B // the polymorphic type of (*ptr) is D ``` ###Incomplete type The following types are *incomplete type*: * the type `void` * class type that has been declared(e.g. by `forward declaration`) but not defined * array of unknown bound(e.g. `int a[][2]`) * array of elements of incomplete type * enumeration type from the point of declaration until its underlying type is determined.
  • 相关阅读:
    09 python初学 (字符串)
    08 python 初学(字典)
    07 Python初学(元组)
    ubuntu 学习
    10 python 初学(Python 的编码解码)
    12 python 初学(深浅拷贝、集合)
    11 python初学 (文件)
    ubuntu 在 Windows 下的安装
    mysql常用命令总结
    关于Windows 7 下临时IPV6地址的问题,如何禁用它
  • 原文地址:https://www.cnblogs.com/Wojoin/p/5163437.html
Copyright © 2011-2022 走看看