function parameter packs, 1197–1198
unpacking, 1198–1199
function parameters, reference variables, 386–390
function pointers, 1184–1188
variations on, 365–370
function polymorphism, 412
function prototype scope, 454
function prototypes, 309–311, 1330
benefits, 312–313
C++ compared to ANSI C, 312
syntax, 311–312
function wrapper
fixing problems, 1194–1196
options for, 1196–1197
template inefficiences, 1191–1194
functional polymorphism, 564
functions, 18, 29, 48–49.
adaptable binary, 1035
adaptable unary, 1035
algorithms, 1035
groups, 1035–1036
properties, 1036–1037
arguments, 31, 49, 53
arrays, 322–325
multiple, 314–320
passing by value, 313–314
two-dimensional arrays, 337–339
arrays, 320–321
as arguments, 322–325
const keyword, 327–328
design decisions, 325–326
displaying contents of, 327–328
examples, 328–331
filling, 326–327
modifying, 328
pointers, 321–322
ranges, 332–334
two-dimensional arrays, 337–339
binary, 1027, 1030
body, 29
C-style strings
passing as arguments, 339–341
returning, 341–343
calling, 30, 49, 309, 311
case sensitivity, 27, 32
cin.get(), 317
cin.get(ch), 317
class member functions
const member functions, 537
constructors, 524–528, 538–539, 638–639, 659–661, 677–678
copy constructors, 639–644
definitions, 509, 514–516, 523
destructors, 528–529, 538–539
friend member functions, 883–889
implicit member functions, 637–638
inline functions, 517–518
invoking, 523
object membership, 518
private, 513
properties, 777–778
public, 513
qualified names, 514
this pointer, 539–546
unqualified names, 514
compared to container methods, 1039–1041
conversion functions, 677
defining, 306–309
definitions, 29
formatted input, 1094
friend functions, 578–580
creating, 579–580
type conversion, 618–621
function prototypes, 1330
headers, 29–31
inline functions, 379–382
compared to macros, 382
square(), 381–382
input, unformatted, 1102
lambda functions, 1184
language linking, 475–476
library functions, 52
linkage properties, 474–475
non-member, 986–988, 991
objects, returning, 662–664
const objects, 662–665
non-const objects, 663
operator overloading, 587–588
overloading, 237, 412–414, 564
example, 415–418
function signatures, 413
name decoration, 418
overload resolution, 431–438
when to use, 418
pf()364
pointers, 361–362
addresses of functions, obtaining, 362
const keyword, 334–336
declaring, 362–363
example, 364
invoking functions with, 363–364
pointers to pointers, 335
prototypes, 50–52
qualified names, 514
recursion, 357
multiple recursive calls, 359–361
single recursive call, 358–359
return addresses, 909
return types, 30
return values, 49
set_union(), 1020
signatures, 413
string class objects, 353–354
structures, 343–346
passing/returning, 344–351
polar coordinates, 347
rectangular coordinates, 346
structure addresses, passing, 351–353
templates, 419, 422
explicit instantiation, 428–430
explicit specializations, 425–428
implicit instantiation, 428–430
overload resolution, 431–438
overloading, 422–424
transform(), 1031
unary, 1027, 1030
unqualified names, 514
user-defined functions
example, 53–54
function form, 54–55
function headers, 55–56
return values, 57–59
using directive, 59–60
virtual functions, pure virtual functions, 748
void, 307
functor.cpp, 1028
functors, 1026–1027, 1184–1188
adaptable, 1032
concepts, 1027–1030
predefined, 1030–1032
equivalents for operators, 1032
funtemp.cpp, 420
fun_ptr.cpp, 364, 368
G
g++ compiler, 22
gcount() member function, 1109–1114
generate() function, 1294, 1299
generate_n() function, 1294, 1299
generators, 1027
generic programming, 14, 419, 951, 978, 992
associative containers, 1018–1026
multimap, 1023–1025
set, 1019–1022
container concepts, 1007
container methods compared to functions, 1039–1041
properties, 1008–1010
sequence requirements, 1011–1012
container types
deque, 1013
list, 1014–1017
priority_queue, 1017–1018
queue, 1017
stack, 1018
vector, 1012–1013
iterators, 992–997
back insert, 1005–1007
bidirectional, 998
concepts, 1000–1001
copy() function, 1001–1002
forward, 998
front insert, 1005–1007
hierarchy, 999–1000
importance of, 992–996
input, 997–998
insert, 1005–1007
istream iterator template, 1003
ostream iterator template, 1002–1003
output, 998
pointers, 1001
random access, 999
reverse, 1003–1005
types, 997
get() function, 127–130
get() function (cin), 235–237, 241–244
get() member function, 1102–1108
Get() method, 821
getinfo.cpp, 45
getline() function, 126–127, 957–960