The C++ Video Course

Workbook Table of Contents

 
  C++ as a Safer C..................................1
  Comments..........................................1
  Returning from main...............................1
  Declaration at point of use.......................2
  Prototypes........................................7
  Ellipses..........................................7
  Default arguments.................................8
    When to use default arguments..................10
  Overloaded function names........................10
    Resolving overloaded function calls............13
    When to use overloaded function names..........18
    Name mangling..................................19
    Linkage specifications.........................20
  enums............................................25
  bool.............................................27
  inline...........................................28
  The void pointer.................................30
  Ordering of type qualifiers......................31
  Casts............................................31
    static-cast....................................33
    reinterpret-cast...............................34
    const-cast.....................................35
  const correctness................................36
  new and delete...................................37
  const............................................44
  References.......................................46
    References as return values....................51
    Temporary objects..............................54
  Introduction.....................................57
    Type...........................................57
    Subtype........................................57
    Behavior.......................................58
    Relationships..................................58
    Interactions...................................58
    State..........................................60
    Creating the model.............................61
    class scope....................................65
    The scope resolution operator (::).............66
    this...........................................68
    PODS...........................................70
  Special Member Functions.........................71
    Constructors and destructors...................72
    Constructors...................................74
    The default constructor........................75
    Defining a constructor.........................75
    Other constructors.............................77
    When there is no initialization list...........78
    Destructors....................................81
    The copy constructor...........................86
    Implicit declaration of the copy constructor...91
    Assignment operators...........................96
    Operator overloading...........................97
    Writing an assignment operator.................98
    Conversion operators..........................103
    The converting constructor....................103
    explicit......................................106
    converting from a type........................106
    Initialization versus assignment..............114
    Defining non copy assignment operators........115
  Abstraction and encapsulation...................117
    Abstraction...................................117
    The division of responsibility................118
    Access specifiers.............................123
      public......................................123
      private.....................................123
    Encapsulation.................................125
    class.........................................127
    Putting it all together.......................128
    Maintaining the abstraction...................134
    Some questions to ask.........................140
  HAS-A relationships.............................143
    What are relationships?.......................143
    Expressing the HAS-A relationship.............144
    Fine-tuning a HAS-A relationship..............144
    A contained subobject.........................144
    A reference...................................145
    A pointer.....................................147
    Members, references or pointers?..............147
    Observers.....................................149
    mutable.......................................153
  Operator overloading............................155
    The syntax....................................161
    Defining operators as non members.............164
    Temporaries...................................165
    Lifetime of temporaries.......................167
    Member or non member?.........................171
    Friends.......................................173
       Why have a friend?.........................175
       The dangers of friendship..................179
    Maintaining logical relationships
       between operators..........................180
    Members or not?...............................184
    Operators that must be members................184
    operator=.....................................184
    operator[]....................................184
    operator->....................................189
    operator 0 0..................................192
    Operators where we have the choice............195
    The increment and decrement operators.........195
    Overloading of operators within enumerations..199
  The iostream library............................201
    Why replace stdio?............................201
    What do iostreams do?.........................202
    Manipulators..................................204
    An extensible library.........................208
  Static members..................................213
    Defining a static data member.................214
    static member functions.......................217
  The new and delete operators....................219
    The new handler...............................221
    new and delete................................222
    What new and delete do........................223
    The responsibilities of new...................223
    The responsibilities of delete................223
    The responsibilities of array new.............223
    The responsibilities of array delete..........224
    Overloading the default allocation functions..224
    Overloading operator new and operator delete
       as member functions........................226
    Forward declarations..........................232
    Before main executes..........................233
  Order of construction of non-local objects with
    static duration...............................234
  Placement new...................................238
  Value versus reference semantics................243
  Nested classes..................................254
    A nested class for class string...............256
    The tradeoffs.................................266
  One to many relationships.......................269
  Container classes...............................269
  Iterators.......................................270
    Initializing an iterator......................271
  Virtual file handling...........................273
  Many to many relationships......................279
  Inheritance.....................................281
    The terminology...............................282
    The syntax....................................282
    Upcasting of pointers and references..........285
    Downcasting of pointers and references?.......287
    Slicing.......................................287
    Access and inheritance........................288
    The streambuf example.........................290
    Constructors..................................301
    Destructors...................................303
    Assignment and inheritance....................305
    The iostream hierarchy........................311
    stringstreams.................................312
    fstreams......................................316
    Inheritance versus composition................319
    private and protected inheritance.............320
    Inheritance or containment?...................325
    LIKE-A relationships..........................326
  Object oriented programming.....................331
    Messages......................................331
    Static binding................................335
    Late binding..................................335
    POP or OOP?...................................338
    Defining a virtual function...................342
    Maintaining the abstraction...................348
    Using virtual functions.......................353
    A polymorphic inserter........................360
    Inheritance and friends.......................362
    virtual functions and access..................362
    Calling virtual functions from member
       functions..................................364
    Calling virtual functions from within
       constructors and destructo.................365
    Virtual destructors...........................370
    Virtual constructors..........................373
    Virtual tables................................375
    The costs of calling virtual functions........378
  Modifying existing classes......................381
    Extending a class.............................381
    Restricting a class...........................383
    Modifying existing classes....................385
    Pointers to members...........................389
    Pointers to static member functions...........394
    Pointer to member conversions.................394
    Multiple inheritance..........................397
    An example....................................398
    The costs of multiple inheritance.............400
      casting.....................................401
      Ambiguity...................................403
    Virtual base classes..........................408
    Dominance.....................................412
    Alternatives to multiple inheritance..........413
    Abstract base classes.........................417
    Runtime type identification...................423
    The dynamic-cast operator.....................423
    Type identification...........................426
  Index...........................................428

*C++ Video Course Description
*Workbook Introduction
*Product List

 

Go Shopping