function, 553
is not polymorphic, 569
temporary, 247
object cleanup, see destructor
object creation
constructor, 452
order of construction, 456
multiple base classes, 732
virtual base classes, 745
order of destruction, 485
derived objects, 587
multiple base classes, 733
virtual base classes, 747
object file, 68
and destructor, 485
compared to scope, 254
object-oriented programming, 285, 302, 622
key ideas in, 558–560
oct
manipulator, 827
octal, literal (0num), 38
octal escape sequence ( nn), 40
off-the-end iterator, 97, 394, 425
istream_iterator
, 408
off-the-end pointer, 125
see also ostream
close
, 294
constructor, 293
file marker, 838
file mode, 296
combinations, 298
example, 299
file random access, 838
off_type
, 839
open
, 293
pos_type
, 839
random IO sample program, 840
seek
and tell
members, 838–842
open, 293
open
_file, example of, 370, 383
open_file
program, 299
order of evaluation
comma operator, 172
conditional operator, 172
logical operator, 172
sizeof
, 167
addition (+
), 150
string
, 86
pointer, 123
address-of (&
), 115
arrow (–>), 164
class member access, 445
and conversion, 179
and equality, 161
container, 328
multiple inheritance, 737
pointer, 120
string
, 86
to signed
, 37
to unsigned
, 37
yields lvalue, 160
bitwise AND (&
), 156
bitwise exclusive or (^
), 156
bitwise not (~
), 155
bitwise OR (|
), 156
bitwise OR (|
), example, 290
comma (,
), 168
operand order of evaluation, 172
comma (,), example, 289
compound assginment (e.g.,+=), iterator, 313
compound assignment (e.g.,+=), 13, 30, 161
string
, 86
arithmetic, 162
bitwise, 162
conditional (?:
), 165
operand order of evaluation, 172
decrement (--)
iterator, 312
prefix yields lvalue, 162
reverse iterator, 412
dereference (*
), 98
and increment, 163
iterator, 98
on map
yields pair
, 362
pointer, 119
division (/), 150
class member access, 445
string
, 85
algorithm, 421
container, 322
container adaptor, 350
string
, 347
greater-than-or-equal (>=), 30, 153
and dereference, 163
pointer, 114
prefix yields lvalue, 162
reverse iterator, 412
container, 322
container adaptor, 350
string, 347
Sales_item
, 516
istream_iterator, 408
string, 81
precedence and associativity, 158
used by algorithm, 420
less-than-or-equal (<=), 13, 30, 153
logical AND (&&), 152
operand order of evaluation, 172
logical NOT (!), 153
logical OR (||), 152
operand order of evaluation, 172
modulus (%), 151
multiplication (*), 150
bitset
, 106
ostream_iterator, 408
string, 81
precedence and associativity, 158
pointer to member
arrow (–>*), 783
dot (.*), 783
container defined type, 317
member function definition, 262
to override name lookup, 449
sizeof
, 167
subscript ([ ]
)
bitset, 105
deque
, 325
map
, 363
string, 87
and multi-dimensioned array, 142
and pointer, 124
array, 113
valid subscript range, 88
yields lvalue, 88
subtraction (-
), 150
pointer, 123
unary minus (-
), 150
unary plus (+
), 150
operator alternative name, 46
operator delete
function, 760, 806
compared to deallocate
, 761
compared to delete
expression, 760
operator delete
member, 764
and inheritance, 764
example, 769
CachedObj
, 770
interface, 764
operator delete []
member, 765
operator new
function, 760, 806
compared to allocate
, 761
compared to new
expression, 760
operator new
member, 764
example, 769
CachedObj
, 769
interface, 764
operator new []
member, 765
operator overloading, see overloaded operator
options to main
, 243
order of construction, 456, 749
multiple base classes, 732
virtual base classes, 746
order of destruction, 485, 749
derived objects, 587
multiple base classes, 733
virtual base classes, 747
comma operator, 172
conditional operator, 172
logical operator, 172
ordering, strict weak, 360, 389
OrQuery
, 609
definition, 618
eval
function, 619
see also manipulator
condition state, 287
floatfield
member, 831
flushing output buffer, 290
format state, 825
inheritance hierarchy, 740
no containers of, 310
no copy or assign, 287
not flushed if program crashes, 292
output (<<
), 7
precedence and associativity, 158
precision
member, 829
seek and tell members, 838
tie
member, 292
unsetf
member, 831
and class type, 410
constructors, 408
limitations, 411
operations, 410
output iterator, 417
output operator (<<
), 408
used with algorithms, 411
see also ostream
str, 301
out
(file mode), 296
out_of__stock
, 699
output, standard, 6
bitset
, 106
ostream_iterator
, 408
overloaded operator, 513
formatting, 514
must be nonmember, 514
precedence and associativity, 158
Sales_item
, 514
overflow, 150
overflow_error
, 219
overload resolution, see function matching
using
declarations, 728
using
directive, 729
compared to redeclaration, 266
compared to template specialization, 673
friend declaration, 467
linkage directive, 803
namespaces, 727
scope, 268
virtual, 593
overloaded member function, 436
on const
, 442
overloaded operator, 189, 482, 503
<<
(output operator), 513
*
(dereference), 524
&
(address-of), 511
–> (arrow operator), 525
[ ] (subscript), 522
reference return, 522
()
(call operator), 530
and copy constructor, 484
check for self-assignment, 490
Message
, 490
rule of three, 485
valuelike classes, 501
>>
(input operator), 515
error handling, 516–517
must be nonmember, 514
<<
(output operator)
formatting, 514
must be nonmember, 514
Sales_item
, 514
&&
(logical AND), 511
||
(logical OR), 511
, (comma operator), 511
addition (+
), Sales_item, 517
ambiguous, 550
arithmetic operators, 517
as virtual function, 615
binary operator, 508
candidate functions, 549
compound assignment (e.g.,+=), 511
Sales_item, 521
consistency between relational and equality operators, 520
design, 510–513
explicit call to, 509
explicit call to postfix operators, 529
function matching, 547–551
member and this
pointer, 483
member vs. nonmember function, 508, 512
postfix increment (++
) and decrement (--
) operators, 528
precedence and associativity, 507
prefix increment (++
) and decrement (--
) operators, 527
relational operators, 511, 520
require class-type parameter, 507
unary operator, 508
overloading, see overloaded function
operator, see overloaded operator
as return type from map::insert
, 365
as return type from set::insert
, 373
default constructor, 357
definition, 356
initialization, 356
make_pair
, 358
operations, 357
public data members, 357
Panda
, 731
virtual inheritance, 741
array and buffer overflow, 242
array type, 238–244
C-style string, 242
const, 231
const
reference, 235
overloading, 275
ellipsis, 244
function pointer, 278
linkage directive, 804
initialization of, 229
library container, 237
lifetime, 255
local copy, 230
matching, 229
ellipsis, 244
template specialization, 673
with class type conversion, 541
multi-dimensioned array, 241
nonconst
reference, 232
nonreference type, 230
uses copy constructor, 478
of member function, 260
vector
type, 237
passing, 229
pointer to const
, 231
overloading, 275
pointer to function, 278
linkage directive, 804
pointer to nonconst
, 231
reference
to array type, 240
to pointer, 236
template, see template parameter
and main
, 243
type checking
and template argument, 638
of reference to array, 240
parameter list, 3, 29, 226, 228
member function definition, 446
parentheses, override precedence, 169
partial specialization, 678, 684
partial_sort
, 818
partial_sort_copy
, 818
partial_sum
, 824
partition
, 817
compared to construct
, 762
plus<T>
, 534
array, 122
arrow (–>), 164
as initializer of vector
, 140
as parameter, 231
assignment, 120
char*, see C-style string
class member copy control, 492–501
copy constructor, 480
destructor, 485
strategies, 499
compared to iterator, 114
compared to reference, 121
const, 128
const
pointer to const
, 129
container constructor from, 308
conversion from derived to base, 567
conversion from derived to multiple base, 734
conversion to bool
, 182
conversion to void
, 181
synthesized copy control, 494
declaration style, 116–117
definition, 115
delete
, 176
dynamic_cast
, example, 773
function returning, 228
implicit this
, 260, 281, 431, 440
in overloaded operator, 508
static
member functions, 469
initialization, 117–119
is polymorphic, 569
multi-dimensioned array, 143
new, 174
null, 118
off-the-end, 125
pitfalls with generic programs, 671
reference parameter, 236
relational operator, 132
return type and local variable, 249
handle class, 599
overloaded –> (arrow operator) and * (dereference), 524
overloaded (++
) and (*
), 526
subscript operator, 124
to pointer, 122
typedef, 129
typeid
operator, 776
uninitialized, 117
volatile, 800
pointer to const
, 127
argument, 231
conversion from nonconst
, 127
parameter, 231
overloading, 275
pointer to function, 276–279
definition, 276
exception specifications, 711
function returning, 228
initialization, 277
linkage directive, 803
overloaded functions, 279
parameter, 278
return type, 278
typedef, 276
and typedef, 783
arrow (–>*), 783
definition, 781
dot (.*
), 783
function pointer, 782
function table, 785
pointer to nonconst
argument, 231
parameter, 231
compile time polymorphism via templates, 624
run time polymorphism in C++, 569
pop
priority_queue
, 352
queue
, 352
stack
, 351
pop_back
, sequential container, 326
pop_front
, sequential container, 326
portable, 797
postfix decrement (--)
overloaded operator, 528
yields rvalue, 163
postfix increment (++)
and dereference, 163
overloaded operator, 528
precedence, 124, 146, 149, 168, 189
of assignment, 160
of conditional, 166
of dot and derefernece, 164
of increment and dereference, 163
of IO operator, 158
of pointer to member and call operator, 782
overloaded operator, 507
pointer parameter declaration, 241
precedence table, 170
prefix decrement (--
), 163
overloaded operator, 527
yields lvalue, 162
prefix increment (++)
and dereference, 163
overloaded operator, 527
yields lvalue, 162
variable, 71
prev_permutation
, 821
preventing copies of class objects, 481
print_total
, 559
explained, 568
printable character, 88
printValues
program, 240, 242, 243
constructors, 349
relational operator, 350
private
class, 496
copy constructor, 481
inheritance, 571
inheritance, 561
private inheritance, 622
program
factorial
, 250
find_val
, 234
gcd
, 226
isShorter
, 235
make_plural
, 248
open_file
, 299
ptr_swap
, 237
rgcd
, 250
vector
capacity, 331
book finding
using equal_range
, 379
using find
, 377
using upper_bound
, 378
bookstore, 26
bookstore exception classes, 698
CachedObj
, 766
duplicate words, 400–404
revisited, 531
find last word, 414
GT6
, 403
Handle class, 667
int
instantiation, 668
operations, 668
Sales_item
instantiation, 669
isShorter, 403
message handling classes, 486
Query
design, 609–611
interface, 610
operations, 607
Queue
, 648
copy_elems member, 652
destroy
member, 651
pop
member, 651
push
member, 652
random IO example, 840
restricted word count, 374
Sales_item
handle class, 599
Screen
class template, 655
TextQuery
, 383
class definition, 382
design, 380
interface, 381
vector
, capacity, 331
vowel counting, 200
word count, 363
word transformation, 370
ZooAnimal
class hierarchy, 731
programmer-defined header, 67–72
programming
object-oriented, 285, 302, 622
protected, inheritance, 571, 622
protected
access label, 562, 622
protected
keyword, 562
ptr_swap
program, 237
public
inheritance, 561
pure virtual function, 596, 622
example, 609
push
priority_queue
, 352
queue
, 352
stack
, 351
vector
, 94
back_inserter
, 399
sequential container, 318
push_front
front_inserter
, 406
sequential container, 318
put_Msg_in_Folder
, 489
Query
, 610
&
(bitwise AND), 610
definition, 614
~
(bitwise NOT), 610
definition, 614
|
(bitwise OR), 610
definition, 614
<<
(output operator), 615
definition, 613
design, 609–611
interface, 610
operations, 607
Query_base
, 609
definition, 612
member functions, 609
queue
<< (output operator), 659
assign, 662
definition, 648
design, 647
destroy
member, 651
final class definition, 664
interface, 627
member template declarations, 661
operations, 627
pop
member, 651
push
, specialized, 677
push
member, 652
template version, char*, 675
constructors, 349
relational operator, 350
QueueItem
, 648
as nested class, 787
constructor, 789
definition, 788
friendship, 658
CachedObj
, 768
allocation explained, 769
Raccoon
as virtual base, 741
RAII, see resource allocation is initialization
raise, 750
raise exception, see throw random file IO, 838
random-access iterator, 417, 425
deque
, 417
string
, 417
vector, 417
random_shuffle
, 820
range
left-inclusive, 314
range_error
, 219
rdstate
, 290
referece
, 317
and pointer, 121
const
reference, 59
initialization, 60
conversion from derived to base, 567
conversion from derived to multiple base, 734
dynamic_cast
operator, example, 774
is polymorphic, 569
nonconst
reference, 60
parameter, 232–237
pointer parameter, 236
return type, is lvalue, 249
return type and class object, 440
return type and local variable, 249
return value, 248
to array parameter, 240
reference count, see use count
reference data member, initialization, 455
reference to const, see const reference
relational operator, 153
string
, 85
associative container, 359
container, 321
container adaptor, 350
function object, 533
consistent with equality, 520
pointer, 132
remove
, 819
list
, 423
remove_copy
, 820
remove_copy_if
, 820
remove_if
, 819
list
, 423
remove_Msg_from_Folder
, 491
string
, 342
replace_copy_if
, 815
replace_if
, 816
reserve
string, 336
vector
, 331
reserved identifier, 47
resize
, sequential container, 323
Resource
, 700
resource allocation is initialization, 700–701
auto_ptr
, 702
restricted word count program, 374
return
, container, 381
return
statement, 245–251
from main
, 247
implicit, 245
const
reference, 249
function, 281
function pointer, 278
linkage directive, 804
member function definition, 446
no implicit return type, 228
nonreference, 247
uses copy constructor, 478
of virtual function, 564
pointer to function, 278
reference, 248
reference yields lvalue, 249
void
, 245
return value
conversion, 246
copied, 247
reverse
, 819
list
, 423
reverse iterator, 405, 412–415, 425
--
(decrement), 412
++
(increment), 412
base, 414
compared to iterator, 413, 414
example, 414
requires --
(decrement), 413
reverse_copy
, 819
reverse_iterator
, 412
container, 316
rfind
, string, 346
rgcd program, 250
right
manipulator, 832
rotate
, 819
rotate_copy
, 820
exception for virtual destructors, 588
run time, 75
error, 38
run-time type identification, 772–780, 807
classes with virtual functions, 772
compared to virtual functions, 777
dynamic_cast
, 773
example, 773
throws bad_cast
, 774
to poiner, 773
to reference, 774
type-sensitive equality, 778
typeid, 775
and virtual functions, 775
example, 776
returns type_info
, 776
constructor from string
, 218
safety, exception, 700
Sales_item
, 21
compare
function, 604
compound assignment (e.g.,+=), 521
conversion, 461
default constructor, 263
equality operators (==
), (!=), 519
explicit
constructor, 462
handle class, 599
clone
function, 602
definition, 600
design, 599
multiset
of, 605
using generic Handle
, 669
input (>>), 516
istream
constructor, 452
no relational operators, 520
operations, 21
output (<<), 514
avg_price
definition, 261
string
constructor, 452
scientific
manipulator, 830
block, 193
compared to object lifetime, 254
for
statement, 15
friend declaration, 466
function, 227
function template specialization, 674
multiple inheritance, 737
namespace, 713–717
statement, 194
template parameter, 629
using declaration, 720
using
directive, 721
example, 722
name collisions, 723
scope (::)
base class members, 569
namespace member, 750
scope operator (::
), 8, 30, 78, 108
container defined type, 317
member function definition, 262
namespace member, 713
to override class-specific memory allocation, 765
to override name lookup, 449
Screen
, 435
class template, 655
concatenating operations, 441
display
, 442
do_display
, 442
friends, 465
get
definition, 446
get
members, 436
get_cursor
definition, 446
CachedObj
, 768
Menu
function table, 785
move
members, 441
set
members, 441
simplified, 781
size_type
, 435
ScreenPtr
, 523
arrow operator (–>), 525
dereference (*
), 524
use counted, 523
ScrPtr
, 523
search
, 813
search_n
, 813
self-assignment
auto_ptr
, 705
check, 490
use counting, 498
semicolon (;
), 3
semicolon (;
), class definition, 440
inclusion model for templates, 644
of templates, 643
separate compilation model for templates, 645, 684
sequence, escape, 74
sequence (Xnnn), hexadecimal escape, 40
sequential container, 306, 354
assign, 328
assignment (=
), 328
back
, 324
clear
, 327
const_iterator
, 316
const_reverse_iterator
, 316
constructor from element count uses copy constructor, 478
uses element default constructor, 460
constructors, 307–309
deque
, 306
element type constraints, 309, 323
empty
, 323
erase
, 326
front
, 324
insert
, 319
iterator, 316
list
, 306
operations, 316–330
performance characteristics, 333
pop_back
, 326
pop_front
, 326
priority_queue
, 348
push_back
, 318
push_front
, 318
queue
, 348
rbegin
, 412
rend
, 412
resize
, 323
returning a, 381
size
, 323
size_type
, 316
stack
, 348
supports relational operators, 321
swap
, 329
types defined by, 316
value_type
, 317
vector
, 306
as element type, 311
assignment (=
), 328
begin
, 372
bidirectional iterator, 417
clear
, 359
constructors, 372
count
, 372
element type constraints, 309
empty
, 359
end, 372
equal_range
, 379
find, 372
insert
, 373
iterator, 374
key type constraints, 360
lower_bound, 377
operations, 358
overriding the default comparison, 604
rbegin
, 412
rend
, 412
return alternatives, 381
return type from insert
, 373
reverse_iterator
, 412
size
, 359
supports relational operators, 359
swap
, 329
upper_bound
, 377
value_type
, 372
set_difference
, 822
set_symmetric_difference
, 822
set_union
, 822
setfill
manipulator, 832
setprecision
manipulator, 829
setw
manipulator, 832
short, 34
short-circuit evaluation, 152
overloaded operator, 508
shorterString
, 248
showbase
manipulator, 827
showpoint
manipulator, 831
conversion to unsigned
, 36, 180
size
, 108
string, 83
vector
, 93
associative container, 359
priority_queue
, 352
queue
, 352
sequential container, 323
stack
, 351
and array, 113
string, 84
vector
, 93
container, 316
sizeof
operator, 167
skipws
manipulator, 833
conversion operator, 537
handle class, 599
overloaded –> (arrow operator) and * (dereference), 524
overloaded (++
) and (*
), 526
naming convention, 264
specialization
class template
definition, 675
member defined outside class body, 676
partial, 678
partial specialization, 684
class template member, 677
declaration, 677
function template
compared to overloaded function, 673
example, 672
scope, 674
template, namespaces, 730
splice
, list, 423
sstream
str, 301
stable_partition
, 817
constructors, 349
relational operator, 350
state, condition, 302
do while
, 210
return, 245–251
return, local variable, 247, 249
statement block, see block
statement label, 214
statement scope, 194
static
(file static), 719
as default argument, 471
class template, 665
accessed through an instantiation, 666
definition, 666
const
data member, initialization, 470
const
member function, 469
data member, 469
as constant expression, 471
inheritance, 576
member function, 467
this
pointer, 469
static
object, local, 255, 281
determines name lookup, 590
multiple inheritance, 735
argument, 229
function return value, 246
str
, 301
strcat
, 133
strcmp
, 133
strcpy
, 133
stream
istream_iterator
, 407
ostream_iterator
, 407
flushing buffer, 290
and class type, 410
limitations, 411
used with algorithms, 411
not flushed if program crashes, 292
type as condition, 19
stream iterator, 425
strict weak ordering, 360, 389
string
, C-style, see C-style string string, 80–89
addition, 86
addition to string
literal, 87
append
, 342
are case sensitive, 344
as sequential container, 335
assign, 340
assignment (=
), 86
c_str
, 140
c_str
, example, 294
capacity
, 336
compare, 347
compared to C-style string, 134
compound assignment, 86
concatenation, 86
default constructor, 52
empty
, 83
equality (==), 85
equality operator, 347
erase
, 340
find, 344
find_first_not_of
, 346
find_first_of
, 345
find_last_not_of
, 346
find_last_of
, 346
getline
, 82
getline
, example, 300
header, 80
input operation as condition, 82
input operator, 81
insert
, 340
output operator, 81
random-access iterator, 417
replace
, 342
reserve
, 336
rfind
, 346
size
, 83
size_type
, 84
subscript operator, 87
substr
, 342
addition to string, 87
and string
library type, 81, 140
and C-style string, 140
concatenation, 41
stringstream
, 285, 299–301, 302
see also istream
see also ostream
str, 301
strlen
, 133
strncat
, 133
strncpy
, 133
struct
,see also class
default access label, 433
default inheritance access label, 574
in variable definition, 440
Studio, Visual, 4
subscript ([ ]
), 87, 108, 146, 389
bitset, 105
deque
, 325
map
, 363
string, 87
and multi-dimensioned array, 142
and pointer, 124
array, 113
overloaded operator, 522
reference return, 522
valid subscript range, 88
yields lvalue, 88
string, 88
vector
, 96
array, 114
substr
, string, 342
subtraction (-
), 150
pointer, 123
container, 329
swap_ranges
, 816
default
label, 203
and break
, 201–203
case label, 201
compared to if
, 199
execution flow, 201
expression, 203
variable definition, 204
synthesized assignment (=
), 483, 503
multiple inheritance, 737
pointer members, 493
synthesized copy constructor, 479, 503
multiple inheritance, 737
pointer members, 493
virtual base class, 747
synthesized copy control, volatile, 800
synthesized default constructor, 264, 281, 459, 474
inheritance, 581
synthesized destructor, 485, 486
multiple inheritance, 737
pointer members, 493
(tab character), 40
table of library name and header, 810
template
see also class template
see also function template
see also instantiation
class member, see member template
link time errors, 635
overview, 624
template
keyword, 625
and function argument type checking, 638
class template, 628
conversion, 638
deduction, 684
from function pointer, 640
deduction for class template member function, 653
deduction for function template, 637
explicit and class template, 636
explicit and function template, 642
and function pointer, 643
specifying, 642
pointer, 671
template argument deduction, 637
template class, see class template
template function, see function template
template parameter, 625, 628–633, 684
and member templates, 663
name, 628
restrictions on use, 629
nontype parameter, 625, 628, 632, 684
class template, 655
must be constant expression, 633
scope, 629
type parameter, 625, 628, 630, 684
uses of inside class definition, 649
template parameter list, 625, 684
template specialization, 672, 684
class member declaration, 677
compared to overloaded function, 673
definition, 675
example, 672
function declaration, 672, 673
member defined outside class body, 676
member of class template, 677
parameter matching, 673
partial specialization, 678, 684
scope, 674
template<>, see template specialization
temporary object, 247
terminate
, 219, 219, 224, 692, 750
TextQuery
class definition, 382
main
program using, 383
program design, 380
program interface, 381
revisited, 609
this pointer
implicit parameter, 260, 281, 431, 440
in overloaded operator, 483, 508
static member functions, 469
throw
, 216, 216, 224, 689, 750
pointer to local object, 690
rethrow, 695
tolower
, 88
top
priority_queue
, 352
stack, 351
toupper
, 88
transform
, 815
transformation program, word, 370
translation unit, see source file trunc (file mode), 296
try
keyword, 217
type
function return, 281
library, 29
nested, see nsted class786
determines name lookup, 590
name lookup and multiple inheritance, 735
type checking, 44
argument, 229
with class type conversion, 541
ellipsis parameter, 244
name lookup, 269
reference to array argument, 240
type identification, run-time, 772–780, 807
type template parameter, 628, 630, 684
see also template parameter type_info, 807
header, 219
name
member, 780
no copy or assign, 780
operations, 779
returned from typeid
, 776
typedef
and pointer, 129
and pointer to member, 783
pointer to function, 276
and virtual functions, 775
example, 776
returns type_info, 776
typename, keyword
compared to class
, 631
in template parameter, 630
inside template definition, 632
U_Ptr
, 496
unary function object, 533
unary minus (-
), 150
unary plus (+
), 150
uncaught exception, 692
dangling pointer, 176
synthesized copy control, 494
invalidated iterator, 315
uninitialized class data member, 459
uninitialized pointer, 117
uninitialized variable, 51
underflow_error
, 219
uninitialized pointer, 117
uninitialized_fill
, 755
as nested type, 794
example, 794
limitations on, 793
union
keyword, 793
list, 423
unitbuf
, manipulator flushes the buffer, 291
local to file, 718
replace file static
, 719
literal (numU or numu), 39
unsigned char, 36
upper_bound
, 814
associative container, 377
book finding program, 378
example, 607
uppercase
manipulator, 828
design overview, 495
generic class, 667
held in companion class, 496
pointer to, 600
self-assignment check, 498
using
declaration, 78, 108, 720, 750
access control, 573
class member access, 574
in header, 80
overloaded function, 728
overloaded inherited functions, 593
scope, 720
overloaded function, 729
pitfalls, 724
scope, 721
example, 722
name collisions, 723
utility
header, 356
map
subscript operator, 363
vector
, 92
and dynamically allocated array, 136
deque, 309
list, 309
of dynamically allocated object, 175
and resize
, 324
sequential container, 309
vector, 309
value_type
, 389
map, multimap, 361
sequential container, 317
set, multiset, 372
varargs
, 244
define before use, 44
defined after case label, 204
definition, 48
definitions and goto
, 215
constructor, 452
scope, 55
vector
, 757
capacity
, 757
memory allocation strategy, 757
push_back
, 758
reallocate
, 758
size
, 757
using operator new
and delete
, 761
using explicit destructor call, 763
using placement new
, 762
argument, 237
as element type, 311
assign, 328
assignment (=
), 328
at
, 325
back
, 324
capacity
, 331
clear, 327
const_reference
, 317
const_reverse_iterator
, 316
constructor from element count, uses
copy constructor, 478
constructor taking iterators, 140
difference_type
, 316
element type constraints, 309, 323
invalidates iterator, 326
front
, 324
header, 90
initialization from pointer, 140
insert, 319
invalidates iterator, 320
iterator supports arithmetic, 312
memory allocation strategy, 756
memory management strategy, 330
parameter, 237
performance characteristics, 334
pop_back
, 326
invalidates iterator, 321
random-access iterator, 417
reference, 317
relational operators, 321
reserve, 331
resize
, 323
subscript ([ ]), 325
subscript operator, 94
supports relational operators, 313
swap
, 329
type, 91
types defined by, 316
value_type
, 317
vector
capacity program, 331
with class type conversion, 545
ambiguities, 743
conversion, 743
defining base as, 742
derived class constructor, 744
name lookup, 743
order of construction, 746
stream types, 741
virtual function, 559, 566–570, 622
assignment operator, 588
calls resolved at run time, 568
compared to run-time type identification, 777
default argument, 570
derived classes, 564
destructor, 587
multiple inheritance, 736
exception specifications, 710
in constructors, 589
in destructor, 589
introduction, 561
multiple inheritance, 735
no virtual constructor, 588
overloaded, 593
overloaded operator, 615
overriding run-time binding, 570
example, 609
return type, 564
run-time type identification, 772
scope, 594
static, 469
to copy unknown type, 602
type-sensitive equality, 778
virtual
keyword, 559
Visual Studio, 4
return type, 245
pointer, 800
synthesized copy control, 800
vowel counting program, 200
wcerr
, 286
wchar_t
, 34
literal, 40
wchar_t
streams, 286
wcin
, 286
wcout
, 286
weak ordering, strict, 360, 389
wfstream
, 286
what, see exception while statement, 12, 30, 204, 224
condition in, 205
whitespace, 81
wide character streams, 286
wifstream
, 286
window, console, 6
Window_Mgr
, 465
wiostream
, 286
wistream
, 286
wistringstream
, 286
wofstream
, 286
word count program, 363
restricted, 374
word per line processing
istringstream, 300
word transformation program, 370
WordQuery
, 609
definition, 616
wostream
, 286
wostringstream
, 286
wrap around, 38
wstringstream
, 286
Xnnn (hexadecimal escape sequence), 40
ZooAnimal
, using virtual inheritance, 741
ZooAnimal
class hierarchy, 731