Главная » Просмотр файлов » Стандарт C++ 11

Стандарт C++ 11 (1119564), страница 12

Файл №1119564 Стандарт C++ 11 (Стандарт C++ 11) 12 страницаСтандарт C++ 11 (1119564) страница 122019-05-09СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 12)

— end note ]:Table 4 — Keywordsalignasalignofasmautoboolbreakcasecatchcharchar16_tchar32_tclassconstconstexprconst_castcontinuedecltypedefaultdeletedodoubledynamic_castelseenumexplicitexportexternfalsefloatforfriendgotoifinlineintlongmutablenamespacenewnoexceptnullptroperatorprivateprotectedpublicregisterreinterpret_castreturnshortsignedsizeofstaticstatic_assertstatic_caststructswitchtemplatethisthread_localthrowtruetrytypedeftypeidtypenameunionunsignedusingvirtualvoidvolatilewchar_twhile20) On systems in which linkers cannot accept extended characters, an encoding of the universal-character-name may be usedin forming valid external identifiers.

For example, some otherwise unused character or sequence of characters may be used toencode the \u in a universal-character-name. Extended characters may produce a long external identifier, but C++ does notplace a translation limit on significant characters for external identifiers. In C++, upper- and lower-case letters are considereddifferent for all identifiers, including external identifiers.§ 2.12© ISO/IEC 2011 – All rights reserved23ISO/IEC 14882:2011(E)2Furthermore, the alternative representations shown in Table 5 for certain operators and punctuators (2.6)are reserved and shall not be used otherwise:Table 5 — Alternative representationsandnot_eq2.131and_eqorbitandor_eqbitorxorcomplxor_eqnotOperators and punctuators[lex.operators]The lexical representation of C++ programs includes a number of preprocessing tokens which are used inthe syntax of the preprocessor or are converted into tokens for operators and punctuators:preprocessing-op-or-punc: one{}[<::><%new delete?+*!=<ˆ=&=|=<=>=&&and and_eqbitandoror_eqxorof]%>::/><<||bitorxor_eq#%:.%+=>>++compl##%:%:.*ˆ-=>>=-not(;):&*=<<=,not_eq|/===->*...~%=!=->Each preprocessing-op-or-punc is converted to a single token in translation phase 7 (2.2).2.14Literals2.14.11Kinds of literals[lex.literal][lex.literal.kinds]There are several kinds of literals.21literal:integer-literalcharacter-literalfloating-literalstring-literalboolean-literalpointer-literaluser-defined-literal2.14.2Integer literals[lex.icon]integer-literal:decimal-literal integer-suffixoptoctal-literal integer-suffixopthexadecimal-literal integer-suffixoptdecimal-literal:nonzero-digitdecimal-literal digitoctal-literal:0octal-literal octal-digit21) The term “literal” generally designates, in this International Standard, those tokens that are called “constants” in ISO C.§ 2.14.224© ISO/IEC 2011 – All rights reservedISO/IEC 14882:2011(E)hexadecimal-literal:0x hexadecimal-digit0X hexadecimal-digithexadecimal-literal hexadecimal-digitnonzero-digit: one of1 2 3 4 5 6 7 8 9octal-digit: one of0 1 2 3 4 5 6 7hexadecimal-digit: one of0 1 2 3 4 5 6 7 8 9a b c d e fA B C D E Finteger-suffix:unsigned-suffix long-suffixoptunsigned-suffix long-long-suffixoptlong-suffix unsigned-suffixoptlong-long-suffix unsigned-suffixoptunsigned-suffix: one ofu Ulong-suffix: one ofl Llong-long-suffix: one ofll LL1An integer literal is a sequence of digits that has no period or exponent part.

An integer literal may havea prefix that specifies its base and a suffix that specifies its type. The lexically first digit of the sequenceof digits is the most significant. A decimal integer literal (base ten) begins with a digit other than 0 andconsists of a sequence of decimal digits. An octal integer literal (base eight) begins with the digit 0 andconsists of a sequence of octal digits.22 A hexadecimal integer literal (base sixteen) begins with 0x or 0X andconsists of a sequence of hexadecimal digits, which include the decimal digits and the letters a through fand A through F with decimal values ten through fifteen. [ Example: the number twelve can be written 12,014, or 0XC. — end example ]2The type of an integer literal is the first of the corresponding list in Table 6 in which its value can berepresented.Table 6 — Types of integer constantsSuffixnoneDecimal constantsintlong intlong long intu or Uunsigned intunsigned long intunsigned long long intlong intlong long intl or LOctal or hexadecimal constantintunsigned intlong intunsigned long intlong long intunsigned long long intunsigned intunsigned long intunsigned long long intlong intunsigned long intlong long intunsigned long long int22) The digits 8 and 9 are not octal digits.§ 2.14.2© ISO/IEC 2011 – All rights reserved25ISO/IEC 14882:2011(E)Table 6 — Types of integer constants (continued)3SuffixBoth u or Uand l or Lll or LLDecimal constantsunsigned long intunsigned long long intlong long intBoth u or Uand ll or LLunsigned long long intOctal or hexadecimal constantunsigned long intunsigned long long intlong long intunsigned long long intunsigned long long intIf an integer literal cannot be represented by any type in its list and an extended integer type (3.9.1) canrepresent its value, it may have that extended integer type.

If all of the types in the list for the literal aresigned, the extended integer type shall be signed. If all of the types in the list for the literal are unsigned, theextended integer type shall be unsigned. If the list contains both signed and unsigned types, the extendedinteger type may be signed or unsigned. A program is ill-formed if one of its translation units contains aninteger literal that cannot be represented by any of the allowed types.2.14.3Character literals[lex.ccon]character-literal:’ c-char-sequence ’u’ c-char-sequence ’U’ c-char-sequence ’L’ c-char-sequence ’c-char-sequence:c-charc-char-sequence c-charc-char:any member of the source character set exceptthe single-quote ’, backslash \, or new-line characterescape-sequenceuniversal-character-nameescape-sequence:simple-escape-sequenceoctal-escape-sequencehexadecimal-escape-sequencesimple-escape-sequence: one of\’ \" \?\\\a \b \f \n \r\t\voctal-escape-sequence:\ octal-digit\ octal-digit octal-digit\ octal-digit octal-digit octal-digithexadecimal-escape-sequence:\x hexadecimal-digithexadecimal-escape-sequence hexadecimal-digit1A character literal is one or more characters enclosed in single quotes, as in ’x’, optionally preceded byone of the letters u, U, or L, as in u’y’, U’z’, or L’x’, respectively.

A character literal that does not beginwith u, U, or L is an ordinary character literal, also referred to as a narrow-character literal. An ordinarycharacter literal that contains a single c-char has type char, with value equal to the numerical value of the§ 2.14.326© ISO/IEC 2011 – All rights reservedISO/IEC 14882:2011(E)encoding of the c-char in the execution character set. An ordinary character literal that contains more thanone c-char is a multicharacter literal. A multicharacter literal has type int and implementation-definedvalue.2A character literal that begins with the letter u, such as u’y’, is a character literal of type char16_t.

Thevalue of a char16_t literal containing a single c-char is equal to its ISO 10646 code point value, provided thatthe code point is representable with a single 16-bit code unit. (That is, provided it is a basic multi-lingualplane code point.) If the value is not representable within 16 bits, the program is ill-formed. A char16_tliteral containing multiple c-chars is ill-formed.

A character literal that begins with the letter U, such asU’z’, is a character literal of type char32_t. The value of a char32_t literal containing a single c-char isequal to its ISO 10646 code point value. A char32_t literal containing multiple c-chars is ill-formed. Acharacter literal that begins with the letter L, such as L’x’, is a wide-character literal. A wide-characterliteral has type wchar_t.23 The value of a wide-character literal containing a single c-char has value equalto the numerical value of the encoding of the c-char in the execution wide-character set, unless the c-charhas no representation in the execution wide-character set, in which case the value is implementation-defined.[ Note: The type wchar_t is able to represent all members of the execution wide-character set (see 3.9.1).— end note ].

The value of a wide-character literal containing multiple c-chars is implementation-defined.3Certain nongraphic characters, the single quote ’, the double quote ", the question mark ?,24 and thebackslash \, can be represented according to Table 7. The double quote " and the question mark ?, canbe represented as themselves or by the escape sequences \" and \? respectively, but the single quote ’and the backslash \ shall be represented by the escape sequences \’ and \\ respectively. Escape sequencesin which the character following the backslash is not listed in Table 7 are conditionally-supported, withimplementation-defined semantics. An escape sequence specifies a single character.Table 7 — Escape sequencesnew-linehorizontal tabvertical tabbackspacecarriage returnform feedalertbackslashquestion marksingle quotedouble quoteoctal numberhex number4NL(LF)HTVTBSCRFFBEL\?’"ooohhh\n\t\v\b\r\f\a\\\?\’\"\ooo\xhhhThe escape \ooo consists of the backslash followed by one, two, or three octal digits that are taken to specifythe value of the desired character.

Характеристики

Тип файла
PDF-файл
Размер
14,26 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6499
Авторов
на СтудИзбе
303
Средний доход
с одного платного файла
Обучение Подробнее