A
absInt
, 571
()
(call operator), 571
class derivation list, 596
default inheritance access, 616
default member access, 268
derived class, 613
derived-to-base conversion, 613
design, 614
inherited members, 612
local class, 853
nested class, 844
private
, 268public
, 268using
declaration, 615
derived-to-base conversion, 613
Account
, 301
bookstore program, 406
Action
, 839
adaptor, 372
add
, Sales_data
, 261
add_item
, Basket
, 633
add_to_Folder
, Message
, 522
adjacent_difference
, 882
adjacent_find
, 871
advice
always initialize a pointer, 54
avoid casts, 165
avoid undefined behavior, 36
choosing a built-in type, 34
define small utility functions, 277
define variables near first use, 48
don’t create unnecessary
regex
objects, 733forwarding parameter pattern, 706
keep lambda captures simple, 394
prefix vs. postfix operators, 148
rule of five, 541
use
move
sparingly, 544use constructor initializer lists, 289
when to use overloading, 233
writing compound expressions, 139
initialization, 298
algorithm
header, 376
see alsoAppendix A
architecture
_if
versions, 414operate on iterators not containers, 378
overloading pattern, 414
associative container and, 430
bind
as argument, 397can’t change container size, 385
element type requirements, 377
function object arguments, 572
istream_iterator
, 404iterator range, 376
library function object, 575
ostream_iterator
, 404sort comparison, requires strict weak ordering, 425
function, 386
two input ranges, 413
type independence, 377
accumulate
, 379bookstore program, 406
copy
, 382count
, 378equal_range
, 722equal
, 380fill_n
, 381fill
, 380find
, 376for_each
, 391replace_copy
, 383replace
, 383set_intersection
, 647sort
, 384stable_sort
, 387transform
, 396unique
, 384
alias declaration
all_of
, 871
alloc_n_copy
, StrVec
, 527
allocate
, allocator
, 481
allocator
, 481, 481–483, 491, 524–531
compared to
operator new
, 823construct
, 482forwards to constructor, 527
compared to
operator delete
, 823
alternative operator name, 46
alternative_sum
, program, 682
ambiguous
AndQuery
, 637
any
, bitset
, 726
any_of
, 871
app
(file mode), 319
append
, string
, 362
argc
, 219
buffer overflow, 215
to pointer conversion, 214
C-style string, 216
conversion, function matching, 234
default, 236
forwarding, 704
initializes parameter, 203
iterator, 216
low-level
const
, 213main
function, 218multidimensional array, 218
nonreference parameter, 209
uses copy constructor, 498
pointer, 214
reference to
const
, 211top-level
const
, 212
argument list, 202
argument-dependent lookup, 797
move
andforward
, 798
argv
, 219
arithmetic
in equality and relational operators, 144
signed
tounsigned
, 34to
bool
, 162operators, 139
compound assignment (e.g.,
+=
), 147function object, 574
overloaded, 560
machine-dependent, 32
arithmetic (addition and subtraction)
argument conversion, 214
auto
returns pointer, 117begin
function, 118compound type, 113
function arguments, 214
template argument deduction, 679
decltype
returns array type, 118definition, 113
dimension, constant expression, 113
allocator
, 481can’t use
begin
andend
, 477can’t use range
for
statement, 477delete[]
, 478empty array, 478
new[]
, 477shared_ptr
, 480unique_ptr
, 479elements and destructor, 502
end
function, 118initialization, 114
initializer of
vector
, 125no copy or assign, 114
of
char
initialization, 114parameter
buffer overflow, 215
converted to pointer, 215
function template, 654
pointer to, 218
reference to, 217
return type, 204
trailing, 229
type alias, 229
decltype
, 230sizeof
, 157subscript range, 116
subscript type, 116
understanding complicated declarations, 115
array
see alsocontainer
see alsosequential container
[]
(subscript), 347=
(assignment), 337assign
, 338copy initialization, 337
default initialization, 336
definition, 336
header, 329
list initialization, 337
overview, 327
random-access iterator, 412
swap
, 339
assert
preprocessor macro, 241, 251
assign
assignment, vs. initialization, 42, 288
associative array, seemap
associative container, 420, 447
and library algorithms, 430
members
begin
, 430emplace
, 432end
, 430equal_range
, 439erase
, 434insert
, 432override default comparison, 425
override default hash, 446
overview, 423
associativity, 134, 136–137, 168
=
(assignment), 145?:
(conditional operator), 151dot and dereference, 150
increment and dereference, 148
IO operator, 155
overloaded operator, 553
at
ate
(file mode), 319
auto_ptr
deprecated, 471
see alsolocal variable
see alsoparameter
and destructor, 502
avg_price
, Sales_data
, 259