subtraction operator (-), overloading, 574–578
type cast, 943–944
type info structure, 934
typeid, 934, 939–944
unary minus, 601
unary operators, 601, 1234
operator[]() method, 787, 1259, 1283–1286
OR operators
bitwise OR (|), 1237–1238
logical OR (||), 260–262
alternative representations, 270
example, 261–262
precedence, 269
or.cpp, 261
ordering
strict weak, 988
total, 988
ostream class, 47, 1065
ostream iterator template, 1002–1003
ostream methods, 1071–1075
ostringstream class, 1142–1145
ourfunc.cpp, 54
outfile.cpp, 290–291
output
buffers, flushing, 1075–1076
classes, ostream, 1070–1075
concatenating, 46–47, 1071–1072
cout
field width display, 1080–1081
fill characters, 1081–1082
floating-point display precision, 1082–1083
formatting data types, 1076–1078
number base display, 1078–1079
printing trailing zeros/decimal points, 1083–1090
cout object, 1069
displaying with cout, 36
concatenated output, 46–47
endl manipulator, 37–38
integer values, 44–45
\n newline character, 38–39
output iterators, 998
out_of_bounds exception, 919
overload resolution, 431–432
best matches, 432–434
exact matches, 432–434
multiple arguments, 438
partial ordering rules, 434–436
overloading
functions, 237, 412–414, 564
example, 415–418
function signatures, 413
name decoration, 418
overload resolution, 431–438
when to use, 418
operators, 101, 564–565
addition operator (+), 569–572
assignment operator, 652–658
example, 565–569
left shift operator (<<), 581–587, 676
member versus nonmember functions, 587–588
multiplication operator (*), 574–578
operator functions, 565
restrictions, 573–574
subtraction operator (-), 574–578
vector class, 588–590
reference parameters, 415
templates, 422–424
overload resolution, 431–438
override, 1183–1184
ownership, 973
P
pairs.cpp, 848
palindromes, 1057
pam() function, 362–363
parameter lists, 30
parameterized types, 419
parameters, 314
templates, 855–858
type, 834
partial ordering rules, 434–436
partial specializations, 851–852
partial_sort() function, 1304, 1307
partial_sort_copy() function, 1304, 1307–1308
partial_sum() function, 1321
partition() function, 1295, 1302–1303
passing
structure addresses, 351–353
structures, 344–351
passing by reference, 386, 389–390
passing objects
by reference, 770
by value, 770
past-the-end iterators, 981–982
peek() member function, 1109–1114
peeker.cpp, 1111
period (.), 255
permutations, 1038
defined, 1318
functions
next_permutation(), 1306, 1319
prev_permutation(), 1319
pf() function, 364
pipe character (|), 1237–1238
logical OR operator (||), 260–262
alternative representations, 270
example, 261–262
precedence, 269
placement new operator, 478–482, 671–676
placenew1.cpp, 671–673
placenew2.cpp, 674–675
plus sign (+)
addition operator (+), overloading, 569–572
concatenation operator (+), strings, 133–134
increment operator (++), 207–208
pointers, 210–211
postfixing, 209–210
prefixing, 209–210
plus_one.cpp, 207
pointed-to values, 172
pointer arithmetic, 167–172
pointer.cpp, 155
pointers, 153, 321–322, 837
assigning values to, 171
auto_ptr, 969, 973–975
C++ philosophy, 155
cautions, 159
compared to pointed-to values, 172
const keyword, 334–336
declaring, 155–159, 171
deferencing, 171–172
delete operator, 163–164
example, 154
function pointers, 361–362
addresses of functions, obtaining, 362
declaring, 362–363
increment/decrement operators, 210–211
inheritance, 737–739
initializing, 157–159
integers, 160
iterators, 1001
member dereferencing operators, 1242–1246
new operator, 160–162
passing variables, 386–390
pointer arithmetic, 167–172
pointer notation, 173
pointers to objects, 665–670
pointers to pointers, 335
stacks of pointers, 837–843
strings, 173–178
this, 539–546
polar coordinates, 347
converting rectangular coordinates to, 348–351
polymorphic public inheritance, 722–723
base-class functions, 777
Brass class declaration, 723–726
Brass class implementation, 727–731
Brass class objects, 732–733
BrassPlus class declaration, 723–726
BrassPlus class implementation, 727–731