{{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 기프트카드 전용특가

기프트카드로 결제하면 전용특가를 받을 수 있습니다

규칙 설명

기프트카드 전용특가는 일부 상품에 대한 특혜가격입니다.

기프트카드 전용특가 상품 구매 시 E-기프트 카드 잔액으로 결제하고 기프트카드 잔액이 주문 내 상품의 총액을 지불하기에 충분하하 기프트카드 전용특가가 자동으로 활성화됩니다.

기프트 카드 잔액으로 결제하지 않거나 기프트카드 잔액이 전항의 요건을 충족하지 못할 경우 기프트카드 전용특가를 활성화할 수 없으며 상품은 정상 가격으로 구매할 수 있습니다.

기프트카드 전용특가 상품 구매 시 잔액이 부족할 경우 장바구니 또는 결제 페이지에서 "충전" 버튼을 클릭하여 기프트카드를 구매 및 충전할 수 있습니다.

기프트카드 전용특가가 있는 상품은 "전용특가"라는 특별한 가격표시가 표시됩니다.

질문이 있으시면 언제든지 고객 서비스에 문의하십시오.

Yami는 기프트카드 전용특가 관련 최종 해석권을 보유합니다.

Yami 판매

서비스 보장

Yami $49 이상 무료 배송
Yami 걱정 없는 반품/교환
Yami 미국에서 발송

배송 정보

  • 미국

    표준 배송 $5.99(알래스카, 하와이 제외), 최종 가격 $49 이상 시 무료 배송

    지역 배송 $5.99(캘리포니아, 뉴욕, 뉴저지, 매사추세츠, 펜실베이니아, 위 주의 일부 지역), 최종 가격 $49 이상 시 무료 배송

    2일 이내 배송(알래스카 및 하와이 포함) $19.99부터 시작

반품 및 교환 정책

Yami는 고객님께 최상의 A/S를 제공하고, 모든 분들이 Yami에서 안심하고 쇼핑할 수 있도록 노력하고 있습니다. Yami의 자영 상품은 반품 및 교환 조건을 충족하는 경우, 상품 수령 후 30일 이내에 반품 및 교환할 수 있습니다(식품은 품질 문제로 인해 7일 이내에 반품 및 교환이 가능합니다. 모든 고객이 안전하고 고품질의 제품을 받을 수 있도록 뷰티 제품은 개봉 또는 사용 후에는 품질 문제를 제외하고 환불 또는 반품을 제공하지 않습니다. 기타 특별 카테고리의 제품은 고객 서비스에 문의하시기 바랍니다).
이해와 지원에 감사드립니다.

상세정보 보기

Yami 판매

Yami E-기프트카드 사용 약관

구매 시 자동 충전을 선택한 경우, 주문 완료 후 기프트카드가 자동으로 계정에 충전됩니다.

구매 시 이메일 발송을 선택한 경우, 주문 완료 후 시스템이 자동으로 카드 번호와 비밀번호를 입력한 이메일로 발송합니다.

이메일을 보낼 때, 모든 사용자는 이메일에 있는 카드 번호와 비밀번호를 사용하여 기프트카드를 충전할 수 있으니, 이메일 정보를 잘 보관하세요.

이메일을 받는 데 문제가 있으면, 고객 서비스에 연락하여 처리해 주세요.

이메일을 보낼 때, 기프트카드가 교환되지 않았다면 이메일을 재발송할 수 있습니다. 이미 다른 사용자에 의해 교환된 경우에는 보상할 수 없습니다.

Yamibuy의 E-기프트카드는 자영 또는 제3자 상품 구매에 사용할 수 있습니다.

Yamibuy의 E-기프트카드는 유효 기간 제한이 없으며, 장기간 유효합니다.

Yami 전자 상품권의 금액은 여러 번에 나눠서 사용할 수 있습니다;

Yami 전자 상품권 업무 규칙의 최종 해석 권한은 Yami 웹사이트에 있습니다.

반품 및 교환 정책

이미 사용된 E-기프트카드는 환불이 불가능합니다.

판매자: JD@CHINA

서비스 보장

Yami $49 이상 무료 배송
Yami 최고의 A/S
Yami 미국 본토에서 발송

배송 정보

  • 미국

    표준 배송 $5.99(알래스카, 하와이 제외), 최종 가격 $49 이상 시 무료 배송

    지역 배송 $5.99(캘리포니아, 뉴욕, 뉴저지, 매사추세츠, 펜실베이니아, 위 주의 일부 지역), 최종 가격 $49 이상 시 무료 배송

    2일 이내 배송(알래스카 및 하와이 포함) $19.99부터 시작

반품 및 교환 정책

제품을 받으신 후 30일 이내에 제품을 반품하실 수 있습니다. 반품된 품목은 구매에 대한 원본 송장을 포함하여 원래 포장된 새 품목이어야 합니다. 고객이 자신의 비용으로 제품을 반품합니다.

JD@CHINA 판매

서비스 보장

Yami 점포간 $:amount 이상 구매 시 무료 배송
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.

포인트 규칙

모든 품목은 Yamibuy 의 프로모션이나 포인트 이벤트에서 제외됩니다.

반품 및 교환 정책

제품을 받으신 후 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