swaps.cpp, 387–388
swapv() function, 389
switch.cpp, 276–277
switch statement, 274–278
compared to if else statement, 279–280
enumerators as labels, 278–279
example, 275–278
syntax, 275
symbolic constants, 72
symbolic names, 90–92
T
TableTennisPlayer class, 708–710
tabtenn0.cpp, 709
tabtenn0.h, 708
usett0.cpp, 710
tabtenn0.cpp, 709
tabtenn0.h, 708
tabtenn1.cpp, 717
tabtenn1.h, 716
tags, 140
Technical Report 1 (TR1), 1206
template aliases, C++11, 866
template classes, 830–837
arrays, non-type arguments, 843–845
auto_ptr, 969, 973–975
complex, 1045
deque, 1013
explicit instantiations, 850
explicit specializations, 850–851
implicit instantiations, 850
list, 1014–1017
member functions, 1014–1016
members, 854–855
partial specializations, 851–852
pointers, stacks of pointers, 837–843
priority_queue, 1017–1018
queue, 1017
stack, 1018
valarray, 1045–1046, 1049–1051
vector, 979–991, 1012–1013, 1045–1046, 1049–1051
adding elements to, 982–983
past-the-end iterators, 981–982
removing ranges of, 982
shuffling elements in, 987
sorting, 987
vect1.cpp example, 980–981
vect2.cpp sample program, 984–986
vect3.cpp sample program, 988–991
versatility, 845–846
default type parameters, 849
multiple type parameters, 847
recursive use, 846–847
template functions, 438
alternative function syntax, 441
decltype, 439
type, 439
template keyword, 831
template parameter packs, 1197–1198
unpacking, 1198–1199
templates.
angle brackets, 1162
autoptr, 1333
export, 1162
friend classes, 858
bound template friend functions, 861–864
non-template friend functions, 858–861
unbound template friend functions, 864–865
function templates, 419, 422
explicit instantiation, 428–430
explicit specializations, 425–428
implicit instantiation, 428–430
overload resolution, 431–438
overloading, 422–424
inefficiences, function wrapper, 1191–1194
initializer_list, C++11, 1051–1053
istream iterator, 1003
nested classes, 892–896
ostream iterator, 1002–1003
parameters, 855–858
range-based for loop, 1161
STL (Standard Template Library), 1334
string template class, 1249–1250
append methods, 1265–1266
assignment methods, 1260, 1266
comparison methods, 1263–1265
concatenation methods, 1266
constants, 1251
constructors, 1253–1257
copy methods, 1269
data methods, 1251–1253
erase methods, 1267–1268
input/output, 1269–1270
insertion methods, 1267
memory-related methods, 1258
replacement methods, 1268–1269
search methods, 1260–1263
string access methods, 1259
template definition, 1249
types, 1250–1251
valarray, 1162
variadic templates, 866, 1197
recursion, 1199–1202
template and function parameter packs, 1197–1198
unpacking the packs, 1198–1199
tempmemb.cpp, 852
temporary files, random access, 1141–1142
temporary variables, 392–394
tempover.cpp, 434–437
tempparm.cpp, 856–857
terminate() function, 928–930
terminators, 30
testing bit values, 1241–1242
tests, loop tests, 196–197
text, reading with loops, 234
cin.get() function, 235–237, 241–244
cin object, 234–235
end-of-file conditions, 237–241
sentinel characters, 234
text files, 287–288, 1129
reading, 292–298
writing to, 288–292
textin1.cpp, 234
textin2.cpp, 236
textin3.cpp, 239
textin4.cpp, 242
third-generation specialization, 425–426
this pointer, 539
throw keyword, 900
throwing exceptions, 900, 915–916
tilde, 529, 1237
time, 1009
time-delay loops, 229–230
tmp2tmp.cpp, 862–864
toggling bits, 1241
tokens, 39
alternative tokens, table of, 1222
tolower() function, 273, 1041
top-down design, 12
top-down programming, 331
topfive.cpp, 353
topval() method, 543
total ordering, 988
totals, calculating cumulative totals, 1320
toupper() function, 273
trailing zeros/decimal points, printing, 1083–1087, 1090
traits type, 1250
transform() function, 1030–1031, 1041, 1294, 1297