B. Stroustrup - The C++ Programming Language (794319)
Текст из файла
TheC++ProgrammingLanguageFourth EditionBjarne StroustrupUpper Saddle River, NJ • Boston • Indianapolis • San FranciscoNew York • Totonto • Montreal • London • Munich • Paris • MadridCapetown • Sydney • Tokyo • Singapore • Mexico CityMany of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Wherethose designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printedwith initial capital letters or in all capitals.The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of anykind and assume no responsibility for errors or omissions.
No liability is assumed for incidental or consequential damages inconnection with or arising out of the use of the information or programs contained herein.The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, whichmay include electronic versions and/or custom covers and content particular to your business, training goals, marketingfocus, and branding interests. For more information, please contact:U.S. Corporate and Government Sales(800) 382-3419corpsales@pearsontechgroup.comFor sales outside the United States, please contact:International Salesinternational@pearsoned.comVisit us on the Web: informit.com/awLibrary of Congress Cataloging-in-Publication DataStroustrup, Bjarne.The C++ programming language / Bjarne Stroustrup.—Fourth edition.pages cmIncludes bibliographical references and index.ISBN 978-0-321-56384-2 (pbk.
: alk. paper)—ISBN 0-321-56384-0 (pbk. : alk. paper)1. C++ (Computer programming language) I. Title.QA76.73.C153 S77 2013005.13’3—dc232013002159Copyright © 2013 by Pearson Education, Inc.All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission mustbe obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in anyform or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use materialfrom this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, UpperSaddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.This book was typeset in Times and Helvetica by the author.ISBN-13: 978-0-321-56384-2ISBN-10:0-321-56384-0Text printed in the United States on recycled paper at Edwards Brothers Malloy in Ann Arbor, Michigan.Second printing, June 2013ContentsContentsiiiPrefacevPreface to the Fourth Edition ......................................................
vPreface to the Third Edition ........................................................ ixPreface to the Second Edition ..................................................... xiPreface to the First Edition ......................................................... xiiPart I: Introductory Material1.2.3.4.5.Notes to the Reader ..................................................................... 3A Tour of C++: The Basics ......................................................... 37A Tour of C++: Abstraction Mechanisms ...................................
59A Tour of C++: Containers and Algorithms ............................... 87A Tour of C++: Concurrency and Utilities ................................. 111Part II: Basic Facilities6.7.8.9.10.Types and Declarations ............................................................... 135Pointers, Arrays, and References ................................................
171Structures, Unions, and Enumerations ........................................ 201Statements ................................................................................... 225Expressions ................................................................................. 241133ivContents11.12.13.14.15.Select Operations ........................................................................ 273Functions ..................................................................................... 305Exception Handling ....................................................................
343Namespaces ................................................................................. 389Source Files and Programs .......................................................... 419Part III: Abstraction Mechanisms16.17.18.19.20.21.22.23.24.25.26.27.28.29.Classes ........................................................................................ 449Construction, Cleanup, Copy, and Move .................................... 481Overloading .................................................................................
527Special Operators ........................................................................ 549Derived Classes ........................................................................... 577Class Hierarchies ........................................................................ 613Run-Time Type Information ....................................................... 641Templates .................................................................................... 665Generic Programming .................................................................
699Specialization .............................................................................. 721Instantiation ................................................................................ 741Templates and Hierarchies .......................................................... 759Metaprogramming ....................................................................... 779A Matrix Design .........................................................................
827Part IV: The Standard Library30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.Index447857Standard Library Summary ......................................................... 859STL Containers ........................................................................... 885STL Algorithms .......................................................................... 927STL Iterators ............................................................................... 953Memory and Resources ...............................................................
973Utilities ........................................................................................ 1009Strings ......................................................................................... 1033Regular Expressions .................................................................... 1051I/O Streams ................................................................................. 1073Locales ........................................................................................ 1109Numerics .....................................................................................
1159Concurrency ................................................................................ 1191Threads and Tasks ....................................................................... 1209The C Standard Library .............................................................. 1253Compatibility .............................................................................. 12671281PrefaceAll problems in computer sciencecan be solved by another level of indirection,except for the problem of too many layers of indirection.– David J.
WheelerC++ feels like a new language. That is, I can express my ideas more clearly, more simply, andmore directly in C++11 than I could in C++98. Furthermore, the resulting programs are betterchecked by the compiler and run faster.In this book, I aim for completeness. I describe every language feature and standard-librarycomponent that a professional programmer is likely to need. For each, I provide:• Rationale: What kinds of problems is it designed to help solve? What principles underliethe design? What are the fundamental limitations?• Specification: What is its definition? The level of detail is chosen for the expert programmer; the aspiring language lawyer can follow the many references to the ISO standard.• Examples: How can it be used well by itself and in combination with other features? Whatare the key techniques and idioms? What are the implications for maintainability and performance?The use of C++ has changed dramatically over the years and so has the language itself.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.