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

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

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

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

If x or xp refers to a non-dependent type or refers to the current instantiation, the type of y isthe type of the class member access expression. — end note ]14.6.2.3Value-dependent expressions[temp.dep.constexpr]1Except as described below, a constant expression is value-dependent if any subexpression is value-dependent.2An identifier is value-dependent if it is:— a name declared with a dependent type,— the name of a non-type template parameter,— a constant with literal type and is initialized with an expression that is value-dependent.Expressions of the following form are value-dependent if the unary-expression or expression is type-dependentor the type-id is dependent:sizeof unary-expressionsizeof ( type-id )typeid ( expression )typeid ( type-id )alignof ( type-id )noexcept ( expression )[ Note: For the standard library macro offsetof, see 18.2.

— end note ]3Expressions of the following form are value-dependent if either the type-id or simple-type-specifier is dependent or the expression or cast-expression is value-dependent:simple-type-specifier ( expression-listopt )static_cast < type-id > ( expression )const_cast < type-id > ( expression )reinterpret_cast < type-id > ( expression )( type-id ) cast-expression4Expressions of the following form are value-dependent:§ 14.6.2.3© ISO/IEC 2011 – All rights reserved363ISO/IEC 14882:2011(E)sizeof ... ( identifier )5An id-expression is value-dependent if it names a member of an unknown specialization.14.6.2.4Dependent template arguments[temp.dep.temp]1A type template-argument is dependent if the type it specifies is dependent.2A non-type template-argument is dependent if its type is dependent or the constant expression it specifiesis value-dependent.3Furthermore, a non-type template-argument is dependent if the corresponding non-type template-parameteris of reference or pointer type and the template-argument designates or points to a member of the currentinstantiation or a member of a dependent type.4A template template-argument is dependent if it names a template-parameter or is a qualified-id that refersto a member of an unknown specialization.14.6.31Non-dependent names[temp.nondep]Non-dependent names used in a template definition are found using the usual name lookup and bound atthe point they are used.

[ Example:void g(double);void h();template<class T> class Z {public:void f() {g(1);// calls g(double)h++;// ill-formed: cannot increment function;// this could be diagnosed either here or// at the point of instantiation}};void g(int);// not in scope at the point of the template// definition, not considered for the call g(1)— end example ]14.6.41Dependent name resolution[temp.dep.res]In resolving dependent names, names from the following sources are considered:— Declarations that are visible at the point of definition of the template.— Declarations from namespaces associated with the types of the function arguments both from theinstantiation context (14.6.4.1) and from the definition context.14.6.4.11Point of instantiation[temp.point]For a function template specialization, a member function template specialization, or a specialization for amember function or static data member of a class template, if the specialization is implicitly instantiatedbecause it is referenced from within another template specialization and the context from which it is referenced depends on a template parameter, the point of instantiation of the specialization is the point of§ 14.6.4.1364© ISO/IEC 2011 – All rights reservedISO/IEC 14882:2011(E)instantiation of the enclosing specialization.

Otherwise, the point of instantiation for such a specializationimmediately follows the namespace scope declaration or definition that refers to the specialization.2If a function template or member function of a class template is called in a way which uses the definition ofa default argument of that function template or member function, the point of instantiation of the defaultargument is the point of instantiation of the function template or member function specialization.3For a class template specialization, a class member template specialization, or a specialization for a classmember of a class template, if the specialization is implicitly instantiated because it is referenced fromwithin another template specialization, if the context from which the specialization is referenced dependson a template parameter, and if the specialization is not instantiated previous to the instantiation of theenclosing template, the point of instantiation is immediately before the point of instantiation of the enclosingtemplate.

Otherwise, the point of instantiation for such a specialization immediately precedes the namespacescope declaration or definition that refers to the specialization.4If a virtual function is implicitly instantiated, its point of instantiation is immediately following the point ofinstantiation of its enclosing class template specialization.5An explicit instantiation definition is an instantiation point for the specialization or specializations specifiedby the explicit instantiation.6The instantiation context of an expression that depends on the template arguments is the set of declarationswith external linkage declared prior to the point of instantiation of the template specialization in the sametranslation unit.7A specialization for a function template, a member function template, or of a member function or staticdata member of a class template may have multiple points of instantiations within a translation unit, andin addition to the points of instantiation described above, for any such specialization that has a pointof instantiation within the translation unit, the end of the translation unit is also considered a point ofinstantiation.

A specialization for a class template has at most one point of instantiation within a translationunit. A specialization for any template may have points of instantiation in multiple translation units. Iftwo different points of instantiation give a template specialization different meanings according to the onedefinition rule (3.2), the program is ill-formed, no diagnostic required.14.6.4.21Candidate functions[temp.dep.candidate]For a function call that depends on a template parameter, the candidate functions are found using the usuallookup rules (3.4.1, 3.4.2, 3.4.3) except that:— For the part of the lookup using unqualified name lookup (3.4.1) or qualified name lookup (3.4.3), onlyfunction declarations from the template definition context are found.— For the part of the lookup using associated namespaces (3.4.2), only function declarations found ineither the template definition context or the template instantiation context are found.If the function name is an unqualified-id and the call would be ill-formed or would find a better match hadthe lookup within the associated namespaces considered all the function declarations with external linkageintroduced in those namespaces in all translation units, not just considering those declarations found in thetemplate definition and template instantiation contexts, then the program has undefined behavior.14.6.51Friend names declared within a class template[temp.inject]Friend classes or functions can be declared within a class template.

When a template is instantiated, thenames of its friends are treated as if the specialization had been explicitly declared at its point of instantiation.§ 14.6.5© ISO/IEC 2011 – All rights reserved365ISO/IEC 14882:2011(E)2As with non-template classes, the names of namespace-scope friend functions of a class template specialization are not visible during an ordinary lookup unless explicitly declared at namespace scope (11.3).

Suchnames may be found under the rules for associated classes (3.4.2).142 [ Example:template<typename T> struct number {number(int);friend number gcd(number x, number y) { return 0; };};void g() {number<double> a(3), b(4);a = gcd(a,b);// finds gcd because number<double> is an// associated class, making gcd visible// in its namespace (global scope)b = gcd(3,4);// ill-formed; gcd is not visible}— end example ]14.7Template instantiation and specialization[temp.spec]1The act of instantiating a function, a class, a member of a class template or a member template is referredto as template instantiation.2A function instantiated from a function template is called an instantiated function.

A class instantiated froma class template is called an instantiated class. A member function, a member class, a member enumeration,or a static data member of a class template instantiated from the member definition of the class templateis called, respectively, an instantiated member function, member class, member enumeration, or static datamember. A member function instantiated from a member function template is called an instantiated memberfunction. A member class instantiated from a member class template is called an instantiated member class.3An explicit specialization may be declared for a function template, a class template, a member of a classtemplate or a member template.

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

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

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

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