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

Стандарт C++ 98 (1119566), страница 22

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

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

The first expression in the postfix expression is then called the object expression, and the callis as a member of the object pointed to or referred to. In the case of an implicit class member access, theimplied object is the one pointed to by this. [Note: a member function call of the form f() is interpretedas (*this).f() (see 9.3.1). ] If a function or member function name is used, the name can be overloaded (clause 13), in which case the appropriate function shall be selected according to the rules in 13.3.The function called in a member function call is normally selected according to the static type of the objectexpression (clause 10), but if that function is virtual and is not specified using a qualified-id then thefunction actually called will be the final overrider (10.3) of the selected function in the dynamic type of theobject expression [Note: the dynamic type is the type of the object pointed or referred to by the currentvalue of the object expression.

12.7 describes the behavior of virtual function calls when the objectexpression refers to an object under construction or destruction. ]2If no declaration of the called function is visible from the scope of the call the program is ill-formed.3The type of the function call expression is the return type of the statically chosen function (i.e., ignoring thevirtual keyword), even if the type of the function actually called is different. This type shall be a complete object type, a reference type or the type void.4When a function is called, each parameter (8.3.5) shall be initialized (8.5, 12.8, 12.1) with its correspondingargument. When a function is called, the parameters that have object type shall have completely-definedobject type. [Note: this still allows a parameter to be a pointer or reference to an incomplete class type.However, it prevents a passed-by-value parameter to have an incomplete class type.

] During the initialization of a parameter, an implementation may avoid the construction of extra temporaries by combiningthe conversions on the associated argument and/or the construction of temporaries with the initialization ofthe parameter (see 12.2). The lifetime of a parameter ends when the function in which it is defined returns.The initialization and destruction of each parameter occurs within the context of the calling function.[Example: the access of the constructor, conversion functions or destructor is checked at the point of call inthe calling function. If a constructor or destructor for a function parameter throws an exception, the searchfor a handler starts in the scope of the calling function; in particular, if the function called has a functiontry-block (clause 15) with a handler that could handle the exception, this handler is not considered.

] Thevalue of a function call is the value returned by the called function except in a virtual function call if thereturn type of the final overrider is different from the return type of the statically chosen function, the valuereturned from the final overrider is converted to the return type of the statically chosen function.5[Note: a function can change the values of its non-const parameters, but these changes cannot affect the values of the arguments except where a parameter is of a reference type (8.3.2); if the reference is to a constqualified type, const_cast is required to be used to cast away the constness in order to modify theargument’s value.

Where a parameter is of const reference type a temporary object is introduced ifneeded (7.1.5, 2.13, 2.13.4, 8.3.4, 12.2). In addition, it is possible to modify the values of nonconstantobjects through pointer parameters. ]6A function can be declared to accept fewer arguments (by declaring default arguments (8.3.6)) or morearguments (by using the ellipsis, ... 8.3.5) than the number of parameters in the function definition (8.4).[Note: this implies that, except where the ellipsis (...) is used, a parameter is available for each argument.]7When there is no parameter for a given argument, the argument is passed in such a way that the receivingfunction can obtain the value of the argument by invoking va_arg (18.7).

The lvalue-to-rvalue (4.1),array-to-pointer (4.2), and function-to-pointer (4.3) standard conversions are performed on the argumentexpression. After these conversions, if the argument does not have arithmetic, enumeration, pointer,pointer to member, or class type, the program is ill-formed. If the argument has a non-POD class type(clause 9), the behavior is undefined. If the argument has integral or enumeration type that is subject to theintegral promotions (4.5), or a floating point type that is subject to the floating point promotion (4.6), thevalue of the argument is converted to the promoted type before the call. These promotions are referred to67ISO/IEC 14882:1998(E)5.2.2 Function call© ISO/IEC5 Expressionsas the default argument promotions.8The order of evaluation of arguments is unspecified.

All side effects of argument expression evaluationstake effect before the function is entered. The order of evaluation of the postfix expression and the argument expression list is unspecified.9Recursive calls are permitted, except to the function named main (3.6.1).10A function call is an lvalue if and only if the result type is a reference.5.2.3 Explicit type conversion (functional notation)[expr.type.conv]1A simple-type-specifier (7.1.5) followed by a parenthesized expression-list constructs a value of the specified type given the expression list. If the expression list is a single expression, the type conversion expression is equivalent (in definedness, and if defined in meaning) to the corresponding cast expression (5.4). Ifthe simple-type-specifier specifies a class type, the class type shall be complete.

If the expression list specifies more than a single value, the type shall be a class with a suitably declared constructor (8.5, 12.1), andthe expression T(x1, x2, ...) is equivalent in effect to the declaration T t(x1, x2, ...); forsome invented temporary variable t, with the result being the value of t as an rvalue.2The expression T(), where T is a simple-type-specifier (7.1.5.2) for a non-array complete object type orthe (possibly cv-qualified) void type, creates an rvalue of the specified type, whose value is determined bydefault-initialization (8.5; no initialization is done for the void() case).

[Note: if T is a non-class typethat is cv-qualified, the cv-qualifiers are ignored when determining the type of the resulting rvalue(3.10). ]5.2.4 Pseudo destructor call[expr.pseudo]1The use of a pseudo-destructor-name after a dot . or arrow -> operator represents the destructor for thenon-class type named by type-name. The result shall only be used as the operand for the function call operator (), and the result of such a call has type void. The only effect is the evaluation of the postfixexpression before the dot or arrow.2The left hand side of the dot operator shall be of scalar type. The left hand side of the arrow operator shallbe of pointer to scalar type. This scalar type is the object type. The type designated by the pseudodestructor-name shall be the same as the object type.

Furthermore, the two type-names in a pseudodestructor-name of the form::opt nested-name-specifieropt type-name :: ~ type-nameshall designate the same scalar type. The cv-unqualified versions of the object type and of the type designated by the pseudo-destructor-name shall be the same type.5.2.5 Class member access[expr.ref]1A postfix expression followed by a dot . or an arrow ->, optionally followed by the keyword template(14.8.1), and then followed by an id-expression, is a postfix expression. The postfix expression before thedot or arrow is evaluated;58) the result of that evaluation, together with the id-expression, determine theresult of the entire postfix expression.2For the first option (dot) the type of the first expression (the object expression) shall be “class object” (of acomplete type).

For the second option (arrow) the type of the first expression (the pointer expression) shallbe “pointer to class object” (of a complete type). In these cases, the id-expression shall name a member ofthe class or of one of its base classes. [Note: because the name of a class is inserted in its class scope(clause 9), the name of a class is also considered a nested member of that class.

] [Note: 3.4.5 describeshow names are looked up after the . and -> operators. ]__________________58) This evaluation happens even if the result is unnecessary to determine the value of the entire postfix expression, for example if theid-expression denotes a static member.68© ISO/IECISO/IEC 14882:1998(E)5 Expressions5.2.5 Class member access3If E1 has the type “pointer to class X,” then the expression E1->E2 is converted to the equivalent form(*(E1)).E2; the remainder of 5.2.5 will address only the first option (dot)59). Abbreviating objectexpression.id-expression as E1.E2, then the type and lvalue properties of this expression are determined asfollows.

In the remainder of 5.2.5, cq represents either const or the absence of const; vq representseither volatile or the absence of volatile. cv represents an arbitrary set of cv-qualifiers, as definedin 3.9.3.4If E2 is declared to have type “reference to T”, then E1.E2 is an lvalue; the type of E1.E2 is T. Otherwise, one of the following rules applies.— If E2 is a static data member, and the type of E2 is T, then E1.E2 is an lvalue; the expression designates the named member of the class. The type of E1.E2 is T.— If E2 is a non-static data member, and the type of E1 is “cq1 vq1 X”, and the type of E2 is “cq2 vq2 T”,the expression designates the named member of the object designated by the first expression.

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

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

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

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