Главная » Просмотр файлов » B. Stroustrup - The C++ Programming Language

B. Stroustrup - The C++ Programming Language (794319), страница 12

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

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

Exception specifications turned out to be worse than useless for improving readability, reliability, and performance. They are deprecated (scheduled for future removal) in the2011 standard. The 2011 standard introduced noexcept (§13.5.1.1) as a simpler solution tomany of the problems that exception specifications were supposed to address.• It was always obvious that separate compilation of templates and their uses would be ideal[Stroustrup,1994]. How to achieve that under the constraints from real-world uses of templates was not at all obvious.

After a long debate in the committee, a compromise wasreached and something called export templates were specified as part of the 1998 standard.It was not an elegant solution to the problem, only one vendor implemented export (the Edison Design Group), and the feature was removed from the 2011 standard. We are still looking for a solution. My opinion is that the fundamental problem is not separate compilationin itself, but that the distinction between interface and implementation of a template is notwell specified.

Thus, export solved the wrong problem. In the future, language support for‘‘concepts’’ (§24.3) may help by providing precise specification of template requirements.This is an area of active research and design [Sutton,2011] [Stroustrup,2012a].1.4.3.2 The Standard LibraryThe greatest and most important innovation in the 1998 standard was the inclusion of the STL, aframework of algorithms and containers, in the standard library (§4.4, §4.5, Chapter 31, Chapter32, Chapter 33).

It was the work of Alex Stepanov (with Dave Musser, Meng Le, and others) basedon more than a decade’s work on generic programming. Andrew Koenig, Beman Dawes, and I didmuch to help get the STL accepted [Stroustrup,2007]. The STL has been massively influentialwithin the C++ community and beyond.Except for the STL, the standard library was a bit of a hodgepodge of components, rather than aunified design. I had failed to ship a sufficiently large foundation library with Release 1.0 of C++[Stroustrup,1993], and an unhelpful (non-research) AT&T manager had prevented my colleaguesand me from rectifying that mistake for Release 2.0.

That meant that every major organization(such as Borland, IBM, Microsoft, and Texas Instruments) had its own foundation library by theSection 1.4.3.2The Standard Library27time the standards work started. Thus, the committee was limited to a patchwork of componentsbased on what had always been available (e.g., the complex library), what could be added withoutinterfering with the major vendor’s libraries, and what was needed to ensure cooperation amongdifferent nonstandard libraries.The standard-library string (§4.2, Chapter 36) had its origins in early work by Jonathan Shopiroand me at Bell Labs but was revised and extended by several different individuals and groups during standardization. The valarray library for numerical computation (§40.5) is primarily the workof Kent Budge.

Jerry Schwarz transformed my streams library (§1.4.2.1) into the iostreams library(§4.3, Chapter 38) using Andrew Koenig’s manipulator technique (§38.4.5.2) and other ideas. Theiostreams library was further refined during standardization, where the bulk of the work was doneby Jerry Schwarz, Nathan Myers, and Norihiro Kumagai.By commercial standards the C++98 standard library is tiny. For example, there is no standardGUI, database access library, or Web application library. Such libraries are widely available but arenot part of the ISO standard.

The reasons for that are practical and commercial, rather than technical. However, the C standard library was (and is) many influential people’s measure of a standardlibrary, and compared to that, the C++ standard library is huge.1.4.4 The 2011 StandardThe current C++, C++11, known for years as C++0x, is the work of the members of WG21. Thecommittee worked under increasingly onerous self-imposed processes and procedures. These processes probably led to a better (and more rigorous) specification, but they also limited innovation[Stroustrup,2007]. An initial draft standard for public review was produced in 2009.

The secondISO C++ standard (ISO/IEC 14882-2011) [C++,2011] was ratified by a 21-0 national vote inAugust 2011.One reason for the long gap between the two standards is that most members of the committee(including me) were under the mistaken impression that the ISO rules required a ‘‘waiting period’’after a standard was issued before starting work on new features. Consequently, serious work onnew language features did not start until 2002. Other reasons included the increased size of modernlanguages and their foundation libraries. In terms of pages of standards text, the language grew byabout 30% and the standard library by about 100%. Much of the increase was due to more detailedspecification, rather than new functionality. Also, the work on a new C++ standard obviously hadto take great care not to compromise older code through incompatible changes.

There are billionsof lines of C++ code in use that the committee must not break.The overall aims for the C++11 effort were:• Make C++ a better language for systems programming and library building.• Make C++ easier to teach and learn.The aims are documented and detailed in [Stroustrup,2007].A major effort was made to make concurrent systems programming type-safe and portable.This involved a memory model (§41.2) and a set of facilities for lock-free programming (§41.3),which is primarily the work of Hans Boehm, Brian McKnight, and others. On top of that, weadded the threads library.

Pete Becker, Peter Dimov, Howard Hinnant, William Kempf, AnthonyWilliams, and others did massive amounts of work on that. To provide an example of what can beachieved on top of the basic concurrency facilities, I proposed work on ‘‘a way to exchange28Notes to the ReaderChapter 1information between tasks without explicit use of a lock,’’ which became futures and async()(§5.3.5); Lawrence Crowl and Detlef Vollmann did most of the work on that. Concurrency is anarea where a complete and detailed listing of who did what and why would require a very longpaper. Here, I can’t even try.1.4.4.1 Language FeaturesThe list of language features and standard-library facilities added to C++98 to get C++11 is presented in §44.2.

With the exception of concurrency support, every addition to the language couldbe deemed ‘‘minor,’’ but doing so would miss the point: language features are meant to be used incombination to write better programs. By ‘‘better’’ I mean easier to read, easier to write, more elegant, less error-prone, more maintainable, faster-running, consuming fewer resources, etc.Here are what I consider the most widely useful new ‘‘building bricks’’ affecting the style ofC++11 code with references to the text and their primary authors:• Control of defaults: =delete and =default: §3.3.4, §17.6.1, §17.6.4; Lawrence Crowl andBjarne Stroustrup.• Deducing the type of an object from its initializer, auto: §2.2.2, §6.3.6.1; Bjarne Stroustrup.I first designed and implemented auto in 1983 but had to remove it because of C compatibility problems.• Generalized constant expression evaluation (including literal types), constexpr: §2.2.3,§10.4, §12.1.6; Gabriel Dos Reis and Bjarne Stroustrup [DosReis,2010].• In-class member initializers: §17.4.4; Michael Spertus and Bill Seymour.• Inheriting constructors: §20.3.5.1; Bjarne Stroustrup, Michael Wong, and Michel Michaud.• Lambda expressions, a way of implicitly defining function objects at the point of their use inan expression: §3.4.3, §11.4; Jaakko Jarvi.• Move semantics, a way of transmitting information without copying: §3.3.2, §17.5.2;Howard Hinnant.• A way of stating that a function may not throw exceptions noexcept: §13.5.1.1; David Abrahams, Rani Sharoni, and Doug Gregor.• A proper name for the null pointer, §7.2.2; Herb Sutter and Bjarne Stroustrup.• The range-for statement: §2.2.5, §9.5.1; Thorsten Ottosen and Bjarne Stroustrup.• Override controls: final and override: §20.3.4.

Alisdair Meredith, Chris Uzdavinis, and VilleVoutilainen.• Type aliases, a mechanism for providing an alias for a type or a template. In particular, away of defining a template by binding some arguments of another template: §3.4.5, §23.6;Bjarne Stroustrup and Gabriel Dos Reis.• Typed and scoped enumerations: enum class: §8.4.1; David E. Miller, Herb Sutter, andBjarne Stroustrup.• Universal and uniform initialization (including arbitrary-length initializer lists and protection against narrowing): §2.2.2, §3.2.1.3, §6.3.5, §17.3.1, §17.3.4; Bjarne Stroustrup andGabriel Dos Reis.• Variadic templates, a mechanism for passing an arbitrary number of arguments of arbitrarytypes to a template: §3.4.4, §28.6; Doug Gregor and Jaakko Jarvi.Section 1.4.4.1Language Features29Many more people than can be listed here deserve to be mentioned.

The technical reports to thecommittee [WG21] and my C++11 FAQ [Stroustrup,2010a] give many of the names. The minutesof the committee’s working groups mention more still. The reason my name appears so often is (Ihope) not vanity, but simply that I chose to work on what I consider important.

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

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

Список файлов книги

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