New C++11 Types

Character types

C++11 introduces char16_t   and char32_t  to facilitate working with UTF-16– and UTF-32-encoded text strings. It’s useful, when encoding strings of characters, to have a type of definite size and signedness :

      • char16_t
      • char32_t

C++11 uses the uprefix for char16_t character and string constants:

u'C'
u"This is a UTF-16 string."

The char16_t type is a natural match for universal character names of the form \u00F6;

Similarly, dealing with Data uses the U prefix for char32_t constants:

U'C'
U"This is a UTF-32 string."

The char32_t type is a natural match for universal character names of the form \U0000222B.

Note: Status of C++0x char16_t/char32_t in BOOST C++ Library

Integer types

Integer type long long int specified in C99 and de facto widely used in C + +. Finally, it legalized and most C++ compilers support it as an extension already. A long long integer is at least 64 bits wide and at least as big as long.

    • long long

C++11 adds the long long and unsigned long long types to support 64-bit integers (or wider) . C++11 provides the ll and LL suffixes for type long long, and ull, Ull, uLL, and ULL for unsigned long long.

    • long long int
    • unsigned long long
    • unsigned long long int
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s