{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
送料無料

配送エリアを切り替えます

在庫情報と配送スピードは地域によって異なる場合があります。

郵便番号の履歴

{{email ? __('Got it!') : __('Restock Alert')}}

商品が再入荷され次第、すぐにメールでお知らせします。

Yami

Jingdong book

C++ Primer英文版(第5版)

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

C++ Primer英文版(第5版)

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
終了まで
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
セール終了まで
タイムセール開始まであと タイムセール終了まであと
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) 詳細
消費期限

現在は販売していません

この商品がいつ再入荷するか、分かりません。

当該地域へ配送できません
売り切れ

製品説明

商品の詳細を全て表示
Editer Recommend

新标准C++11发布,距上一版本已10年;《C++Primer英文版(第5版)》是持续更新的全球C++读本。
经过前四个版本积累,第5版的体例堪称完美。
这一版本作者历时3年完成,极力避免在原版上升级,而是将C++11的新特性真正融入各章节;更将所有代码示例用C++11的简化写法完成,而不是仅单独增加内容。

Content Description

《C++ Primer英文版(第5版)》久负盛名的C++经典教程,时隔八年之久,终迎来的重大升级。除令全球无数程序员从中受益,甚至为之迷醉的--C++大师Stanley B. Lippman的丰富实践经验,C++标准委员会原负责人Josée Lajoie对C++标准的深入理解,以及C++先驱Barbara E. Moo在C++教学方面的真知灼见外,更是基于全新的C++11标准进行了全面而彻底的内容更新。非常难能可贵的是,书中所有示例均全部采用C++11标准改写,这在经典升级版中极其罕见--充分体现了C++语言的重大进展极其全面实践。书中丰富的教学辅助内容、醒目的知识点提示,以及精心组织的编程示范,让《C++ Primer英文版(第5版)》这本书在C++领域的专业地位更加不可动摇。无论是初学者入门,或是中、高级程序员提升,《C++ Primer英文版(第5版)》均为不容置疑的优选。

Author Description

Stanley B. Lippman,目前是微软公司 Visual C++ 团队的架构师。他从1984年开始在贝尔实验室与C++的设计者Bjarne Stroustrup一起从事C++的设计与开发。他在迪士尼和梦工厂从事动画制作,还担任过JPL的高级顾问。

Josée Lajoie,曾经是IBM加拿大研究中心C/C++编译器开发团队的成员,在ISO C++标准委员会工作了7年,担任过ISO核心语言工作组的主席和C++ Report杂志的专栏作家。

Barbara E. Moo,拥有25年软件经验的独立咨询顾问。在AT&T,她与Stroustrup、Lippman一起管理过复杂的C++开发项目。

Catalogue

Preface xxiii

Chapter 1 Getting Started
1.1 Writing a Simple C++Program
1.1.1 Compiling and Executing Our Program
1.2 AFirstLookat Input/Output
1.3 AWordaboutComments
1.4 FlowofControl
1.4.1 The whileStatement
1.4.2 The forStatement
1.4.3 ReadinganUnknownNumberof Inputs
1.4.4 The ifStatement
1.5 IntroducingClasses
1.5.1 The Sales_itemClass
1.5.2 AFirstLookatMemberFunctions
1.6 TheBookstoreProgram

ChapterSummary
DefinedTerms
Part I The Basics

Chapter 2 Variables and Basic Types
2.1 PrimitiveBuilt-inTypes
2.1.1 ArithmeticTypes
2.1.2 TypeConversions
2.1.3 Literals
2.2 Variables
2.2.1 VariableDefinitions
2.2.2 VariableDeclarations andDefinitions
2.2.3 Identifiers
2.2.4 Scopeof aName
2.3 CompoundTypes
2.3.1 References
2.3.2 Pointers
vii
viii Contents
2.3.3 UnderstandingCompoundTypeDeclarations
2.4 constQualifier
2.4.1 References to const
2.4.2 Pointers and const
2.4.3 Top-Level const
2.4.4 constexprandConstantExpressions
2.5 DealingwithTypes
2.5.1 TypeAliases
2.5.2 The autoTypeSpecifier
2.5.3 The decltypeTypeSpecifier
2.6 DefiningOurOwnDataStructures
2.6.1 Defining the Sales_dataType
2.6.2 Using the Sales_dataClass
2.6.3 Writing Our Own Header Files

ChapterSummary
DefinedTerms

Chapter 3 Strings, Vectors, and Arrays
3.1 Namespace usingDeclarations
3.2 Library stringType
3.2.1 Defining and Initializing strings
3.2.2 Operations on strings
3.2.3 Dealing with the Characters in a string
3.3 Library vectorType
3.3.1 Defining and Initializing vectors
3.3.2 Adding Elements to a vector
3.3.3 Other vectorOperations
3.4 IntroducingIterators
3.4.1 UsingIterators
3.4.2 IteratorArithmetic
3.5 Arrays
3.5.1 DefiningandInitializingBuilt-inArrays
3.5.2 AccessingtheElementsof anArray
3.5.3 Pointers andArrays
3.5.4 C-StyleCharacterStrings
3.5.5 InterfacingtoOlderCode
3.6 MultidimensionalArrays

ChapterSummary
DefinedTerms

Chapter 4 Expressions
4.1 Fundamentals
4.1.1 BasicConcepts
4.1.2 PrecedenceandAssociativity
4.1.3 OrderofEvaluation
4.2 ArithmeticOperators
4.3 Logical andRelationalOperators
Contents ix
4.4 AssignmentOperators
4.5 Increment andDecrementOperators
4.6 TheMemberAccessOperators
4.7 TheConditionalOperator
4.8 TheBitwiseOperators
4.9 The sizeofOperator
4.10 CommaOperator
4.11 TypeConversions
4.11.1 TheArithmeticConversions
4.11.2 Other ImplicitConversions
4.11.3 ExplicitConversions
4.12 OperatorPrecedenceTable

ChapterSummary
DefinedTerms

Chapter 5 Statements
5.1 Simple Statements
5.2 StatementScope
5.3 Conditional Statements
5.3.1 The ifStatement
5.3.2 The switchStatement
5.4 IterativeStatements
5.4.1 The whileStatement
5.4.2 Traditional forStatement
5.4.3 Range forStatement
5.4.4 The do whileStatement
5.5 JumpStatements
5.5.1 The breakStatement
5.5.2 The continueStatement
5.5.3 The gotoStatement
5.6 tryBlocks andExceptionHandling
5.6.1 A throwExpression
5.6.2 The tryBlock
5.6.3 StandardExceptions

ChapterSummary
DefinedTerms

Chapter 6 Functions
6.1 FunctionBasics
6.1.1 LocalObjects
6.1.2 FunctionDeclarations
6.1.3 SeparateCompilation
6.2 ArgumentPassing
6.2.1 PassingArgumentsbyValue
6.2.2 PassingArgumentsbyReference
6.2.3 constParametersandArguments
6.2.4 ArrayParameters
x Contents
6.2.5 main:HandlingCommand-LineOptions
6.2.6 FunctionswithVaryingParameters
6.3 Return Types and the returnStatement
6.3.1 FunctionswithNoReturnValue
6.3.2 FunctionsThatReturnaValue
6.3.3 ReturningaPointer toanArray
6.4 OverloadedFunctions
6.4.1 OverloadingandScope
6.5 Features forSpecializedUses
6.5.1 DefaultArguments
6.5.2 Inline and constexprFunctions
6.5.3 Aids for Debugging
6.6 FunctionMatching
6.6.1 ArgumentTypeConversions
6.7 Pointers toFunctions

ChapterSummary
DefinedTerms

Chapter 7 Classes
7.1 DefiningAbstractDataTypes
7.1.1 Designing the Sales_dataClass
7.1.2 Defining the Revised Sales_dataClass
7.1.3 DefiningNonmemberClass-RelatedFunctions
7.1.4 Constructors
7.1.5 Copy,Assignment, andDestruction
7.2 AccessControl andEncapsulation
7.2.1 Friends
7.3 AdditionalClassFeatures
7.3.1 ClassMembersRevisited
7.3.2 Functions That Return *this
7.3.3 ClassTypes
7.3.4 FriendshipRevisited
7.4 ClassScope
7.4.1 NameLookupandClassScope
7.5 ConstructorsRevisited
7.5.1 Constructor InitializerList
7.5.2 DelegatingConstructors
7.5.3 TheRoleof theDefaultConstructor
7.5.4 ImplicitClass-TypeConversions
7.5.5 AggregateClasses
7.5.6 LiteralClasses
7.6 staticClassMembers

ChapterSummary
DefinedTerms
Contents xi
Part II The C++ Library

Chapter 8 The IO Library
8.1 The IOClasses
8.1.1 NoCopyorAssignfor IOObjects
8.1.2 ConditionStates
8.1.3 ManagingtheOutputBuffer
8.2 File Input and Output
8.2.1 Using File Stream Objects
8.2.2 File Modes
8.3 stringStreams
8.3.1 Using an istringstream
8.3.2 Using ostringstreams

ChapterSummary
DefinedTerms

Chapter 9 Sequential Containers
9.1 Overviewof the SequentialContainers
9.2 ContainerLibraryOverview
9.2.1 Iterators
9.2.2 ContainerTypeMembers
9.2.3 begin and endMembers
9.2.4 DefiningandInitializingaContainer
9.2.5 Assignment and swap
9.2.6 ContainerSizeOperations
9.2.7 RelationalOperators
9.3 SequentialContainerOperations
9.3.1 AddingElements toaSequentialContainer
9.3.2 AccessingElements
9.3.3 ErasingElements
9.3.4 Specialized forward_listOperations
9.3.5 ResizingaContainer
9.3.6 ContainerOperationsMayInvalidateIterators
9.4 How a vectorGrows
9.5 Additional stringOperations
9.5.1 Other Ways to Construct strings
9.5.2 Other Ways to Change a string
9.5.3 stringSearchOperations
9.5.4 The compareFunctions
9.5.5 NumericConversions
9.6 ContainerAdaptors

ChapterSummary
DefinedTerms
xii Contents

Chapter 10 Generic Algorithms
10.1 Overview
10.2 AFirstLookat theAlgorithms
10.2.1 Read-OnlyAlgorithms
10.2.2 AlgorithmsThatWriteContainerElements
10.2.3 AlgorithmsThatReorderContainerElements
10.3 CustomizingOperations
10.3.1 PassingaFunctiontoanAlgorithm
10.3.2 LambdaExpressions
10.3.3 LambdaCapturesandReturns
10.3.4 BindingArguments
10.4 Revisiting Iterators
10.4.1 Insert Iterators
10.4.2 iostream Iterators
10.4.3 Reverse Iterators
10.5 StructureofGenericAlgorithms
10.5.1 TheFive IteratorCategories
10.5.2 AlgorithmParameterPatterns
10.5.3 AlgorithmNamingConventions
10.6 Container-SpecificAlgorithms

ChapterSummary
DefinedTerms

Chapter 11 Associative Containers
11.1 UsinganAssociativeContainer
11.2 Overviewof theAssociativeContainers
11.2.1 DefininganAssociativeContainer
11.2.2 Requirements onKeyType
11.2.3 The pairType
11.3 Operations onAssociativeContainers
11.3.1 AssociativeContainer Iterators
11.3.2 AddingElements
11.3.3 ErasingElements
11.3.4 Subscripting a map
11.3.5 AccessingElements
11.3.6 AWordTransformationMap
11.4 TheUnorderedContainers

ChapterSummary
DefinedTerms

Chapter 12 DynamicMemory
12.1 DynamicMemoryandSmartPointers
12.1.1 The shared_ptrClass
12.1.2 ManagingMemoryDirectly
12.1.3 Using shared_ptrs with new
12.1.4 SmartPointers andExceptions
12.1.5 unique_ptr
Contents xiii
12.1.6 weak_ptr
12.2 DynamicArrays
12.2.1 newandArrays
12.2.2 The allocatorClass
12.3 UsingtheLibrary:AText-QueryProgram
12.3.1 Designof theQueryProgram
12.3.2 DefiningtheQueryProgramClasses

ChapterSummary
DefinedTerms
Part III Tools for Class Authors

Chapter 13 Copy Control
13.1 Copy,Assign, andDestroy
13.1.1 TheCopyConstructor
13.1.2 TheCopy-AssignmentOperator
13.1.3 TheDestructor
13.1.4 TheRuleofThree/Five
13.1.5 Using = default
13.1.6 PreventingCopies
13.2 CopyControl andResourceManagement
13.2.1 ClassesThatActLikeValues
13.2.2 DefiningClassesThatActLikePointers
13.3 Swap
13.4 ACopy-ControlExample
13.5 ClassesThatManageDynamicMemory
13.6 MovingObjects
13.6.1 RvalueReferences
13.6.2 MoveConstructor andMoveAssignment
13.6.3 RvalueReferencesandMemberFunctions

ChapterSummary
DefinedTerms

Chapter 14 Overloaded Operations and Conversions
14.1 BasicConcepts
14.2 Input andOutputOperators
14.2.1 Overloading the Output Operator <<
14.2.2 Overloading the Input Operator >>
14.3 Arithmetic andRelationalOperators
14.3.1 EqualityOperators
14.3.2 RelationalOperators
14.4 AssignmentOperators
14.5 SubscriptOperator
14.6 Increment andDecrementOperators
14.7 MemberAccessOperators
14.8 Function-CallOperator
xiv Contents
14.8.1 LambdasAreFunctionObjects
14.8.2 Library-DefinedFunctionObjects
14.8.3 Callable Objects and function
14.9 Overloading,Conversions, andOperators
14.9.1 ConversionOperators
14.9.2 AvoidingAmbiguousConversions
14.9.3 FunctionMatchingandOverloadedOperators

ChapterSummary
DefinedTerms

Chapter 15 Object-Oriented Programming
15.1 OOP:AnOverview
15.2 DefiningBaseandDerivedClasses
15.2.1 DefiningaBaseClass
15.2.2 DefiningaDerivedClass
15.2.3 Conversions andInheritance
15.3 VirtualFunctions
15.4 AbstractBaseClasses
15.5 AccessControl andInheritance
15.6 ClassScopeunder Inheritance
15.7 Constructors andCopyControl
15.7.1 VirtualDestructors
15.7.2 SynthesizedCopyControl andInheritance
15.7.3 Derived-ClassCopy-ControlMembers
15.7.4 InheritedConstructors
15.8 Containers andInheritance
15.8.1 Writing a BasketClass
15.9 TextQueriesRevisited
15.9.1 AnObject-OrientedSolution
15.9.2 The Query_base and QueryClasses
15.9.3 TheDerivedClasses
15.9.4 The evalFunctions

ChapterSummary
DefinedTerms

Chapter 16 Templates and Generic Programming
16.1 DefiningaTemplate
16.1.1 FunctionTemplates
16.1.2 ClassTemplates
16.1.3 TemplateParameters
16.1.4 MemberTemplates
16.1.5 Controlling Instantiations
16.1.6 Efficiency and Flexibility
16.2 TemplateArgumentDeduction
16.2.1 Conversions andTemplateTypeParameters
16.2.2 Function-TemplateExplicitArguments
16.2.3 Trailing Return Types and Type Transformation
Contents xv
16.2.4 FunctionPointers andArgumentDeduction
16.2.5 TemplateArgumentDeductionandReferences
16.2.6 Understanding std::move
16.2.7 Forwarding
16.3 OverloadingandTemplates
16.4 VariadicTemplates
16.4.1 WritingaVariadicFunctionTemplate
16.4.2 PackExpansion
16.4.3 ForwardingParameterPacks
16.5 Template Specializations

ChapterSummary
DefinedTerms
Part IV Advanced Topics

Chapter 17 Specialized Library Facilities
17.1 The tupleType
17.1.1 Defining and Initializing tuples
17.1.2 Using a tuple toReturnMultipleValues
17.2 The bitsetType
17.2.1 Defining and Initializing bitsets
17.2.2 Operations on bitsets
17.3 RegularExpressions
17.3.1 UsingtheRegularExpressionLibrary
17.3.2 TheMatchandRegex IteratorTypes
17.3.3 UsingSubexpressions
17.3.4 Using regex_replace
17.4 RandomNumbers
17.4.1 Random-NumberEngines andDistribution
17.4.2 OtherKinds ofDistributions
17.5 The IOLibraryRevisited
17.5.1 FormattedInput andOutput
17.5.2 UnformattedInput/OutputOperations
17.5.3 RandomAccess toaStream

ChapterSummary
DefinedTerms

Chapter 18 Tools for Large Programs
18.1 ExceptionHandling
18.1.1 ThrowinganException
18.1.2 CatchinganException
18.1.3 Function tryBlocks andConstructors
18.1.4 The noexceptExceptionSpecification
18.1.5 ExceptionClassHierarchies
18.2 Namespaces
18.2.1 NamespaceDefinitions
xvi Contents
18.2.2 UsingNamespaceMembers
18.2.3 Classes,Namespaces,andScope
18.2.4 OverloadingandNamespaces
18.3 Multiple andVirtual Inheritance
18.3.1 Multiple Inheritance
18.3.2 Conversions andMultipleBaseClasses
18.3.3 ClassScopeunderMultiple Inheritance
18.3.4 Virtual Inheritance
18.3.5 Constructors andVirtual Inheritance

ChapterSummary
DefinedTerms

Chapter 19 Specialized Tools and Techniques
19.1 Controlling Memory Allocation
19.1.1 Overloading new and delete
19.1.2 Placement newExpressions
19.2 Run-TimeTypeIdentification
19.2.1 The dynamic_castOperator
19.2.2 The typeidOperator
19.2.3 UsingRTTI
19.2.4 The type_infoClass
19.3 Enumerations
19.4 Pointer toClassMember
19.4.1 Pointers toDataMembers
19.4.2 Pointers toMemberFunctions
19.4.3 UsingMemberFunctions asCallableObjects
19.5 NestedClasses
19.6 union:ASpace-SavingClass
19.7 LocalClasses
19.8 InherentlyNonportableFeatures
19.8.1 Bit-fields
19.8.2 volatileQualifier
19.8.3 Linkage Directives: extern "C"

ChapterSummary
DefinedTerms
Appendix A The Library
A.1 LibraryNames andHeaders
A.2 ABriefTourof theAlgorithms
A.2.1 Algorithms toFindanObject
A.2.2 OtherRead-OnlyAlgorithms
A.2.3 BinarySearchAlgorithms
A.2.4 AlgorithmsThatWriteContainerElements
A.2.5 PartitioningandSortingAlgorithms
A.2.6 GeneralReorderingOperations
A.2.7 PermutationAlgorithms
A.2.8 SetAlgorithms forSortedSequences
Contents xvii
A.2.9 MinimumandMaximumValues
A.2.10 NumericAlgorithms
A.3 RandomNumbers
A.3.1 RandomNumberDistributions
A.3.2 RandomNumberEngines
Index



New Features in C++
2.1.1 long longType
2.2.1 List Initialization
2.3.2 nullptrLiteral
2.4.4 constexprVariables
2.5.1 TypeAliasDeclarations
2.5.2 The autoTypeSpecifier
2.5.3 The decltypeTypeSpecifier
2.6.1 In-Class Initializers
3.2.2 Using auto or decltype forTypeAbbreviation
3.2.3 Range forStatement
3.3 Defining a vector of vectors
3.3.1 List Initialization for vectors
3.4.1 Container cbegin and cendFunctions
3.5.3 Library begin and endFunctions
3.6 Using auto or decltype to SimplifyDeclarations
4.2 RoundingRules forDivision
4.4 Assignment fromaBracedListofValues
4.9 sizeofAppliedtoaClassMember
5.4.3 Range forStatement
6.2.6 Library initializer_listClass
6.3.2 List InitializingaReturnValue
6.3.3 Declaring a Trailing Return Type
6.3.3 Using decltype to Simplify Return Type Declarations
6.5.2 constexprFunctions
7.1.4 Using = default toGenerateaDefaultConstructor
7.3.1 In-class Initializers forMembersofClassType
7.5.2 DelegatingConstructors
7.5.6 constexprConstructors
8.2.1 Using strings for File Names
9.1 The array and forward_listContainers
9.2.3 Container cbegin and cendFunctions
9.2.4 List InitializationforContainers
9.2.5 Container Nonmember swapFunctions
9.3.1 Return Type for Container insertMembers
9.3.1 Container emplaceMembers
xix
xx New Features in C++
9.4 shrink_to_fit
9.5.5 Numeric Conversion Functions for strings
10.3.2 LambdaExpressions
10.3.3 Trailing Return Type in Lambda Expressions
10.3.4 The Library bindFunction
11.2.1 List Initializationof anAssociativeContainer
11.2.3 List Initializing pairReturnType
11.3.2 List Initialization of a pair
11.4 TheUnorderedContainers
12.1 SmartPointers
12.1.1 The shared_ptrClass
12.1.2 List InitializationofDynamicallyAllocatedObjects
12.1.2 autoandDynamicAllocation
12.1.5 The unique_ptrClass
12.1.6 The weak_ptrClass
12.2.1 Range for Doesn't Apply to Dynamically Allocated Arrays
12.2.1 List InitializationofDynamicallyAllocatedArrays
12.2.1 autoCan'tBeUsedtoAllocateanArray
12.2.2 allocator::constructCanUseanyConstructor
13.1.5 Using = default forCopy-ControlMembers
13.1.6 Using = delete toPreventCopyingClassObjects
13.5 MovingInsteadofCopyingClassObjects
13.6.1 RvalueReferences
13.6.1 The Library moveFunction
13.6.2 MoveConstructor andMoveAssignment
13.6.2 Move Constructors Usually Should Be noexcept
13.6.2 MoveIterators
13.6.3 ReferenceQualifiedMemberFunctions
14.8.3 The functionClassTemplate
14.9.1 explicitConversionOperators
15.2.2 overrideSpecifier forVirtualFunctions
15.2.2 Preventing Inheritance by Defining a Class as final
15.3 override and final Specifiers for Virtual Functions
15.7.2 DeletedCopyControl andInheritance
15.7.4 InheritedConstructors
16.1.2 DeclaringaTemplateTypeParameteras aFriend
16.1.2 TemplateTypeAliases
16.1.3 DefaultTemplateArguments forTemplateFunctions
16.1.5 ExplicitControlof Instantiation
16.2.3 Template Functions and Trailing Return Types
16.2.5 ReferenceCollapsingRules
16.2.6 static_cast fromanLvaluetoanRvalue
16.2.7 The Library forwardFunction
16.4 VariadicTemplates
16.4 The sizeof...Operator
16.4.3 VariadicTemplates andForwarding
New Features in C++11 xxi
17.1 The Library TupleClassTemplate
17.2.2 New bitsetOperations
17.3 TheRegularExpressionLibrary
17.4 TheRandomNumberLibrary
17.5.1 Floating-Point FormatControl
18.1.4 The noexceptExceptionSpecifier
18.1.4 The noexceptOperator
18.2.1 InlineNamespaces
18.3.1 InheritedConstructors andMultiple Inheritance
19.3 Scoped enums
19.3 Specifying the Type Used to Hold an enum
19.3 Forward Declarations for enums
19.4.3 The Library mem_fnClassTemplate
19.6 UnionMembersofClassTypes

Book Abstract

"We start by initializing it to denote the first element intext.The loop continues until either we process every element intext or we find an element that is empty.So long as there areelements and we haven't seen an empty element,we print the currentelement.It is worth noting that beeause the loop reads but does notwrite to the elements in text,we use cbegin and cend to control theiteration.Some vector Operations Invalidate Iterators
In 3.3.2 (p.101) we noted that there are implications of thefact that vectors can grow dynamically.We also noted that one suchimplication is that we cannot add elements to a vector inside arange for loop.Another implication is that any operation,such aspush_back,that changes the size of a vector potentially invalidatesall iterators into that vector.We'll explore how iterators becomeinvalid in more detail in 9.3.6 (p.353).
WARNING
For now,it is important to realize that loops that use iteratorsshould not add elements to the container to which the iteratorsrefer.
EXERCISES SECTION 3.4.1
Exercise 3.21: Redo the first exercise from 3.3.3 (p.105) usingiterators.
Exercise 3.22: Revise the loop that printed the first paragraphin text to instead change the elements in text that correspond tothe first paragraph to all uppercase.After you've updatedtext,print its contents.
Exercise 3.23: Write a program to create a vector with ten intelements.Using an iterator,assign each element a value that istwice its current value.Test your program by printing thevector."
……

Introduction

难以计数的程序员已经通过旧版的C++ Primer 学会了C++语言。而在这段时间中,C++本身又已成熟了许多:语言本身的关注点和程序设计社区的关注点都已大大开阔,已经从主要关注机器效率转变为更多地关注编程效率。
2011 年,C++标准委员会发布了ISO C++标准的一个重要修订版。此修订版是C++进化过程中的最新一步,延续了前几个版本对编程效率的强调。新标准的主要目标是:
使语言更为统一,更易于教学
使标准库更简单、安全、使用更高效
使编写高效率的抽象和库变得更简单
因此,在这个版本的C++ Primer 中,我们进行了彻底的修改,使用了最新的C++标准。为了了解新标准是如何全面影响C++语言的,你可以看一下xxiii 页至xxv 页的新特性列表,其中列出了哪些章节涉及了C++的新特性。
新标准增加的一些特性是具有普适性的,例如用于类型推断的auto。这些新特性使本书中的代码更易于阅读和理解。程序(以及程序员!)可以忽略类型的细节,从而更容易集中精力于程序逻辑上来。其他一些新特性,例如智能指针和允许移动的容器,允许我们编写更为复杂的类,而又不必与错综复杂的资源管理做斗争。因此,在本书中开始讲授如何编写自己的类,会比第4 版简单得多。旧标准中阻挡在我们前进路上的很多细节,你我都不必再担心了。
对于本书中涉及新标准定义的新特性的那些部分,我们都已用一个特殊的图标标记出来了。我们希望这些提示标记对那些已经熟悉C++语言核心内容的读者是有帮助的,可以帮助他们决定将注意力投向哪里。对于那些可能尚不支持所有新特性的编译器,我们还希望这些图标能有助于解释这类编译器所给出的编译错误信息。这是因为虽然本书中几乎所有例子都已经用最新版本的GNU 编译器编译通过,但我们知道一些读者可能尚未将编译器更新到最新版本。虽然新标准增加了大量新功能,但核心C++语言并未变化,这构成了本书的大部分内容。读者可以借助这些图标来判断哪些功能可能还没有被自己的编译器所支持。
为什么选择这本书?
现代C++语言可以看作是三部分组成的:
低级语言,大部分继承自 C 语言。
现代高级语言特性,允许我们定义自己的类型以及组织大规模程序和系统。
标准库,它利用高级特性来提供有用的数据结构和算法。
大多数 C++教材按照语言进化的顺序来组织其内容。首先讲授C++的C 子集,然后将C++的更为抽象的一些特性作为高级话题在书的最后进行介绍。这种方式存在两个问题:读者会陷入那些继承自低级程序设计的细节,从而由于挫折感而放弃;读者被强加学习一些坏习惯,随后又需要忘记这些内容。
我们采用一种相反的方法:从一开始就介绍一些语言特性,能让程序员忽略那些继承自低级程序设计的细节。例如,在介绍和使用内置的算术和数组类型时,我们还连同介绍和使用标准库中的类型string 和vector。使用这些类型的程序更易写、易理解且更少出错。
太多时候,标准库被当作一种“高级”话题来讲授。很多教材不使用标准库,而是使用基于字符数组指针和动态内存管理的低级程序设计技术。让使用这种低级技术的程序正确运行,要比编写相应的使用标准库的C++代码困难得多。
贯穿 C++ Primer 全书,我们都在强调好的风格:我们想帮助读者直接养成好的习惯,而不是在获得很多很复杂的知识后再去忘掉那些坏习惯。我们特别强调那些棘手的问题,并对常见的错误想法和陷阱提出警告。
我们还注意解释规则背后的基本原理--使读者不仅知其然,还能知其所以然。我们相信,通过体会程序的工作原理,读者会更快地巩固对语言的理解。
虽然你不必为了学习本书而掌握 C 语言,但我们还是假定你了解足够多的程序设计知识,了解至少一门现代分程序结构语言,知道如何用这门语言编写、编译以及运行程序。特别是,我们假定你已经使用过变量,编写、调用过函数,也使用过编译器。
第 5 版变化的内容
这一版C++ Primer 的新特点是用边栏图标来帮助引导读者。C++是一种庞大的编程语言,它提供了一些为特定程序设计问题定制的功能。其中一些功能对大型项目团队有很重要的意义,但对于小型项目开发可能并无必要。因此,并非每个程序员都需要了解每个语言特性的所有细节。我们加入这些边栏图标来帮助读者弄清哪些内容可以随后再学习,而哪些主题是更为重要的。
对于包含C++语言基础内容的章节,我们用一个小人正在读书的图标加以标记。用这个图标标记的那些章节,涵盖了构成语言核心部分的主题。每个人都应该阅读并理解这些章节的内容。
对于那些涉及高级主题或特殊目的主题的章节,我们也进行了标记。在首次阅读时,这些章节可以跳过或快速浏览。我们用一叠书的图标标记这些章节,指出在这些地方,你可以放心地放下书本。快速浏览这些章节可能是一个好主意,这样你就可以知道有这些特性存在。但在真正需要在自己的程序中使用这些特性之前,没有必要花费时间仔细学习这些主题。
为了进一步引导读者的注意力,我们还用放大镜图标标记了特别复杂的概念。我们希望读者对有这种标记的章节能多花费一些时间彻底理解其中的内容。在这些章节中,至少有一些,其主题的重要性可能不是那么明显;但我们认为,你会发现这些章节涉及的主题对理解C++语言原来至关重要。
交叉引用的广泛使用,是本书采用的另外一种阅读帮助。我们希望这些引用能帮助读者容易地翻阅书中的内容,同时还能在后面的例子涉及到前面的内容时容易地跳回到前面。
没有改变的是,C++ Primer 仍是一本清晰、正确、全面的C++入门教材。我们通过给出一系列复杂度逐步增加的例子来讲授这门语言,这些例子说明了语言特性,展示了如何充分用好C++语言。
本书的结构
我们首先在第I 部分和第II 部分中介绍了C++语言和标准库的基础内容。这两部分包含的内容足够你编写出有意义的程序,而不是只能写一些玩具程序。大部分程序员基本上都需要掌握本书这两部分所包含的所有内容。
除了讲授 C++的基础内容,第I 部分和第II 部分还有另外一个重要目的:通过使用标准库中定义的抽象设施,使你更加适应高级程序设计技术。标准库设施本身是一组抽象数据类型,通常用C++编写。用来设计标准库的,就是任何C++程序员都可以使用的用来构造类的那些语言特性。我们讲授C++语言的一个经验是,在先学习了使用设计良好的抽象类型后,读者会发现理解如何构造自己的类型更容易了。
只有在经过全面的标准库使用训练,并编写了各种标准库所支持的抽象程序后,我们才真正进入到那些允许你编写自己的抽象类型的C++特性中去。本书的第III 部分和第IV 部分介绍了如何编写类的形式的抽象类型。第III 部分包含基础内容,第IV 部分介绍更专门的语言特性。
在第III 部分中,我们将介绍拷贝控制问题,以及其他一些使类能像内置类型一样容易使用的技术。类是面向对象编程和泛型编程的基础,第III 部分也会介绍这些内容。第IV 部分是C++ Primer 的结束部分,它介绍了一些在组织大型复杂系统时非常有用的语言特性。此外,我们将在附录A 中总结标准库算法。
读者帮助
本书的每一章均以一个总结和一个术语表结束,两者一起扼要回顾了这一章的大部分学习重点。读者应该将这些部分作为个人备忘录:如果你不理解某个术语,可以重新学习这一章的相应部分。
在本书中我们还使用了其他一些学习辅助:
重要的术语用加粗字体显示;我们假定读者已经熟悉的重要术语用粗斜体显示。每个术语都会列在章末尾的术语表中。
贯穿全书,我们用高亮显示来提醒读者注意语言的重要部分,对常见的陷阱提出警告,建议好的程序设计习惯,以及提供一般性的使用提示。
为了更好地理解语言特性间和概念间的联系,我们提供大量向前的和向后的交叉引用。
对重要的概念和 C++新程序员常常觉得最困难的主题,我们提供边栏讨论。
学习任何程序设计语言都需要编写程序。为此,贯穿全书我们提供大量程序示例。扩展示例的源码可从下面的网址获得http://www.informit.com/title/0321714113
关于编译器的注意事项
在撰写本书时(2012 年7 月),编译器提供商正在努力工作,升级编译器以匹配最新的ISO 标准。我们使用最多的编译器是GNU 编译器4.7.0。本书中只有一小部分特性在此编译器中尚未实现:继承构造函数、成员函数的引用限定符以及正则表达式库。
致谢
我们要特别感谢标准委员会几位现任和前任委员:Dave Abrahams、Andy Koenig、Stephan T. Lavavej、Jason Merrill、John Spicer 和Herb Sutter 在准备本书的过程中提供的帮助。在理解新标准的一些更微妙之处,他们为我们提供了宝贵的帮助。我们还要感谢很多致力于升级GNU 编译器以实现新标准的人们。
与旧版C++ Primer 中一样,我们要感谢Bjarne Stroustrup 不知疲倦地为C++工作以及他和作者长时间的友谊。我们还要感谢Alex Stepanov 的非凡洞察力,催生了标准库核心的容器和算法。最后,我们要感谢C++标准委员会的所有委员,感谢他们这么多年来在净化、精炼和改进C++语言方面的辛苦工作。
我们衷心感谢审稿人:Marshall Clow、Jon Kalb、Nevin Liber、Dr. C. L. Tondo、Daveed Vandevoorde 和Steve Vinoski,他们建设性的意见帮助我们对全书做出了大大小小的改进。
本书是用 Latex 及其发行版本中的很多包来进行排版的,我们应该感谢Latex社区成员创造出如此强大的排版工具。
最后,我们要感谢Addison-Wesley 公司的优秀员工,他们指导了本书的整个出版过程:Peter Gordon,我们的编辑,他给了我们动力再次修改C++ Primer;Kim Boedigheimer,保证了一切按计划进行;Barbara Wood,她在编辑过程中找到了大量编辑错误;还有Elizabeth Ryan,很高兴再次和她共同工作,她指导我们完成了整个设计和生产流程。

仕様

ブランド Jingdong book
ブランドテリトリー China

免責声明

商品の価格、パッケージ、仕様などの情報は、事前に通知することなく変更される場合があります。私たちは商品情報を迅速に更新するよう努力していますが、実際に受け取った商品を基準にしてください。商品を利用する前に、常に商品に付属するラベル、警告、および説明を読んでください。

利用規約の全文を見ます
お気に入りに追加
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
数量
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
JD@CHINAによって販売します
配送先
{{ __("Ship to United States only") }}
69以上のご注文は送料無料
正規保証

カートに入れました

ショッピングを続ける

おすすめアイテム

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

クーポン

{{ coupon.coupon_name_new | formatCurrency }}
受け取る 受取済み 受け取る終わりました
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
間もなく期限切れ: {{ formatTime(coupon.use_end_time) }}

このアイテムを友達と共有します

Yamiギフトカード特別価格

ギフトカードで支払えば、ギフトカード特別価格が得られます

規則説明

ギフトカード特別価格は、一部商品の特別割引オファーです;

ギフトカード特別価格の商品を購入する場合、決済時に電子ギフトカードで相殺し、ギフトカードの残高が註文したギフトカード特別価格商品の合計価格を支払うのに十分であれば、ギフトカード特別価格を適用することができます;

ギフトカードを利用しない場合、あるいはギフトカードの残高が前項に述べた要件を満たさない場合、ギフトカード特別価格を適用することができません。通常の販売価格で計算されることになり、これらの商品を購入することができます。

ギフトカード特別価格の商品を購入した場合、残高が足りない場合は、カートページまたは決済ページの「チャージ」ボタンをクリックしてギフトカードへの購入とチャージを行うことができます。

もし商品はギフトカード特別価格を持つならば、「特別」の特殊価格表記を表示します;

その他の質問や懸念がある場合は、いつでもカスタマーサービスにお問い合わせください;

Yamibuyは最終解釈権を有します。

Yamiによって販売します

サービス保証

Yami $49以上で送料無料
Yami 返品・交換保証
Yami アメリカから発送

配送情報

  • アメリカ

    スタンダード配送料 $5.99 (アラスカ、ハワイを除く)、最終価格が $49 以上で送料無料

    地方発送 $5.99 (カリフォルニア、ニューヨーク、ニュージャージー、マサチューセッツ、ペンシルベニア、上記州の一部地域); 最終価格が $49 以上で送料無料

    2 日以内の配送 (アラスカとハワイを含む) は送料 $19.99 からです

返品・交換ポリシー

Yamiはお客様が安心して購入できるように努めています。Yamibuy.comから出荷されたほとんどの商品は、受領後30日以内に返品可能です(食品、ドリンク、スナック、乾物、健康補助食品、新鮮な食料品および生鮮食品は、損傷または品質の問題がある場合、受領後7日以内に返品可能です。すべてのお客様に安全で高品質の商品を提供するために、美容製品については、品質の問題ではない限り、開封または利用後の返金や返品は対応できません。一部の商品には異なるポリシーまたは要件がありますので、特別な商品については以下をご覧いただくか、Yamiカスタマーサービスにお問い合わせください)。
ご理解とご支持に感謝します。

利用規約の全文を見ます

Yamiによって販売します

Yamibuy 電子ギフトカードの利用規約

購入時に自動チャージを選択した場合、注文完了後にギフトカードが自動的にアカウントにチャージされます;

購入時にメール送信を選択した場合、注文完了後にシステムが自動的にカード番号とパスワードを入力したメールアドレスに送信します;

メールを送信する際、どのユーザーもメールに送られてきたカード番号とパスワードを使用してギフトカードをチャージできますので、メール情報をしっかり保管してください。

メール受信に問題がある場合は、カスタマーサービスに連絡して処理してもらってください;

メールを送信する際、ギフトカードが交換されていない場合は、メールを再発行することができます。他のユーザーにすでに交換されている場合は、補償することはできません;

Yamibuyの電子ギフトカードは、自営または第三者商品の購入に使用できます;

Yamibuyの電子ギフトカードには有効期限がなく、長期にわたって有効です;

Yamiの電子ギフトカードの金額は、複数回に分けて使用することができます;

Yamiの電子ギフトカードの業務規則の最終的な解釈権は、Yamiウェブサイトに帰属します。

返品・交換ポリシー

既に利用された電子ギフトカードは返金不可です。

販売元: JD@CHINA

サービス保証

Yami $49以上で送料無料
Yami 最高のアフターサービス
Yami 米国本土から発送

配送情報

  • アメリカ

    スタンダード配送料 $5.99 (アラスカ、ハワイを除く)、最終価格が $49 以上で送料無料

    地方発送 $5.99 (カリフォルニア、ニューヨーク、ニュージャージー、マサチューセッツ、ペンシルベニア、上記州の一部地域); 最終価格が $49 以上で送料無料

    2 日以内の配送 (アラスカとハワイを含む) は送料 $19.99 からです

返品・交換ポリシー

商品到着後30日以内であれば返品が可能です。返品される商品は、購入時の請求書の原本を含む、元の梱包のまま新品である必要があります。お客様の費用負担で製品を返品してください。

JD@CHINAによって販売します

サービス保証

Yami $以上の店舗間注文: 送料無料
Yami 30日間返品・交換保証

Yami-中国集荷倉庫

Yamiが中国から厳選し、各優秀店舗の商品をYami中国統合センターに集めて、パッケージをまとめて一度に国際郵送でお客様の住所までお届けします。店舗間で$69以上になれば、送料無料になります。複数の販売者が提供する幅広い商品から選び、店舗間送料無料か低い送料を手軽に楽しめます。

返品・交換ポリシー

30日以内の返品・交換保証を提供します。商品は未使用の元のパッケージに入れられ、購入証明書が添付される必要があります。商品の品質上の問題、間違った配送、または配送漏れなど、販売者によって引き起こされたミスについては、返金処理されます。その他の理由による返品・交換の送料はお客様ご負担となります。すべての商品は長距離を輸送するため、内部品質に影響しない簡易包装のプレスや摩耗等が発生する場合、返品・交換は致しかねます。

配送情報

Yami 中国集荷 Consolidated Shippingの送料は$ 9.99 ($69以上のご注文は送料無料)

中国の販売業者は、ご注文後 2 営業日以内に商品を配達します、すべての荷物は Yami 中国集荷センターに到着し (特別な状況および中国の特定法定休日を除く)、そこで荷物は混載され、 UPSで米国に配送されます。中国から米国への UPS の平均配達時間は約 10 営業日で、直送の追跡番号に基づいていつでも追跡できます。感染拡大の影響で、現在の物流は約5日遅れる可能性があります。パッケージには顧客の署名が必要です。署名されない場合、パッケージが紛失するリスクはお客様が負うことになります。

JD@CHINAによって販売します

サービス保証

69以上のご注文は送料無料
正規保証

配送情報

Yami Consolidated Shipping送料$9.99($69以上のご注文は送料無料になる)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yamiポイント情報

すべての商品は、 Yamibuy.com のプロモーションまたはポイント イベントの対象外となります。

返品・交換ポリシー

商品到着後30日以内であれば返品が可能です。返品される商品は、購入時の請求書の原本を含む、元の梱包のまま新品である必要があります。お客様の費用負担で製品を返品してください。

Yami

Yamiアプリをダウンロードします

トップに戻ります

おすすめアイテム

ブランドについて

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

レビュー{{'('+ commentList.posts_count + ')'}}

商品レビューを書いて、他のユーザーを助ける最初の人になりましょう。

レビューを書く
{{ totalRating }} レビューを書く
  • {{i}}星

    {{i}} 星

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}非表示にします

{{ strLimit(comment,800) }}すべて見る

Show Original

{{ comment.content }}

Yami
すべてを表示します

{{ formatTime(comment.in_dtm) }} 購入済み {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}非表示にします

{{ strLimit(comment,800) }}すべて見る

Show Original

{{ comment.content }}

Yami
すべてを表示します

{{ formatTime(comment.in_dtm) }} 購入済み {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

関連するコメントはありません~

レビュー詳細

Yami Yami

{{ showTranslate(commentDetails) }}非表示にします

{{ strLimit(commentDetails,800) }}すべて見る

Show Original

{{ commentDetails.content }}

Yami
すべてを表示します

{{ formatTime(commentDetails.in_dtm) }} 購入済み {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

最低でも単語一つを入力してください

コメント{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}非表示にします

{{ strLimit(reply,800) }}すべて見る

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

最低でも単語一つを入力してください

キャンセル

これまでのコメントは以上です!

レビューを書きます
商品評価

コメントをお願いします

  • 素敵なユーザーネームは、あなたのコメントをより人気のあるものにします!
  • ここでニックネームを変更すると、アカウントのニックネームも同じに変更されます。
商品レビューをありがとうございます。
あなたの素晴らしいレビューは私たちのコミュニティがより良いアジア商品を見つけるのに役立ちます。

通報します

キャンセル

本当にレビューを削除してもよろしいですか?

キャンセル

過去に閲覧した商品

ブランドについて

Jingdong book