Skip to content

A

absInt, 571

  • () (call operator), 571

abstract base class, 610, 649

  • BinaryQuery, 643

  • Disc_quote, 610

  • Query_base, 636

abstract data type, 254, 305

access control, 611616

  • 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, 268

  • protected, 595, 611

  • public, 268

  • using declaration, 615

access specifier, 268, 305

accessible, 611, 649

  • derived-to-base conversion, 613

Account, 301

accumulate, 379, 882

  • bookstore program, 406

Action, 839

adaptor, 372

add, Sales_data, 261

add_item, Basket, 633

add_to_Folder, Message, 522

address, 33, 78

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, 733

  • forwarding parameter pattern, 706

  • keep lambda captures simple, 394

  • managing iterators, 331, 354

  • prefix vs. postfix operators, 148

  • rule of five, 541

  • use move sparingly, 544

  • use constructor initializer lists, 289

  • when to use overloading, 233

  • writing compound expressions, 139

aggregate class, 298, 305

  • initialization, 298

algorithm header, 376

algorithms, 376, 418

  • see alsoAppendix A

  • architecture

  • _copy versions, 383, 414

  • _if versions, 414

  • naming convention, 413414

  • operate on iterators not containers, 378

  • overloading pattern, 414

  • parameter pattern, 412413

  • read-only, 379380

  • reorder elements, 383385, 414

  • write elements, 380383

  • associative container and, 430

  • bind as argument, 397

  • can’t change container size, 385

  • element type requirements, 377

  • function object arguments, 572

  • istream_iterator, 404

  • iterator category, 410412

  • iterator range, 376

  • lambda as argument, 391, 396

  • library function object, 575

  • ostream_iterator, 404

  • sort comparison, requires strict weak ordering, 425

  • supplying comparison operation, 386, 413

  • function, 386

  • lambda, 389, 390

  • two input ranges, 413

  • type independence, 377

  • use element’s == (equality), 385, 413

  • use element’s < (less-than), 385, 413

  • accumulate, 379

  • bookstore program, 406

  • copy, 382

  • count, 378

  • equal_range, 722

  • equal, 380

  • fill_n, 381

  • fill, 380

  • find_if, 388, 397, 414

  • find, 376

  • for_each, 391

  • replace_copy, 383

  • replace, 383

  • set_intersection, 647

  • sort, 384

  • stable_sort, 387

  • transform, 396

  • unique, 384

alias declaration

all_of, 871

alloc_n_copy, StrVec, 527

allocate, allocator, 481

allocator, 481, 481483, 491, 524531

  • allocate, 481, 527

  • compared to operator new, 823

  • construct, 482

  • forwards to constructor, 527

  • deallocate, 483, 528

  • compared to operator delete, 823

  • destroy, 482, 528

alternative operator name, 46

alternative_sum, program, 682

ambiguous

  • conversion, 583589

  • multiple inheritance, 806

  • function call, 234, 245, 251

  • multiple inheritance, 808

  • overloaded operator, 588

AndQuery, 637

  • class definition, 644

  • eval function, 646

anonymous union, 848, 862

any, bitset, 726

any_of, 871

app (file mode), 319

append, string, 362

argc, 219

argument, 23, 26, 202, 251

  • array, 214219

  • 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, 213

  • main function, 218

  • multidimensional array, 218

  • nonreference parameter, 209

  • pass by reference, 210, 252

  • pass by value, 209, 252

  • uses copy constructor, 498

  • uses move constructor, 539, 541

  • passing, 208212

  • pointer, 214

  • reference parameter, 210, 214

  • reference to const, 211

  • top-level const, 212

argument list, 202

argument-dependent lookup, 797

  • move and forward, 798

argv, 219

arithmetic

  • conversion, 35, 159, 168

  • in equality and relational operators, 144

  • integral promotion, 160, 169

  • signed to unsigned, 34

  • to bool, 162

  • operators, 139

  • compound assignment (e.g., +=), 147

  • function object, 574

  • overloaded, 560

  • type, 32, 78

  • machine-dependent, 32

arithmetic (addition and subtraction)

array, 113130

  • [] (subscript), 116, 132

  • argument and parameter, 214219

  • argument conversion, 214

  • auto returns pointer, 117

  • begin function, 118

  • compound type, 113

  • conversion to pointer, 117, 161

  • function arguments, 214

  • template argument deduction, 679

  • decltype returns array type, 118

  • definition, 113

  • dimension, constant expression, 113

  • dynamically allocated, 476, 476484

  • allocator, 481

  • can’t use begin and end, 477

  • can’t use range for statement, 477

  • delete[], 478

  • empty array, 478

  • new[], 477

  • shared_ptr, 480

  • unique_ptr, 479

  • elements and destructor, 502

  • end function, 118

  • initialization, 114

  • initializer of vector, 125

  • multidimensional, 125130

  • no copy or assign, 114

  • of char initialization, 114

  • parameter

  • 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, 230

  • sizeof, 157

  • subscript range, 116

  • subscript type, 116

  • understanding complicated declarations, 115

array

assert preprocessor macro, 241, 251

assign

  • array, 338

  • invalidates iterator, 338

  • sequential container, 338

  • string, 362

assignment, vs. initialization, 42, 288

assignment operators, 144147

associative array, seemap

associative container, 420, 447

associativity, 134, 136137, 168

  • = (assignment), 145

  • ?: (conditional operator), 151

  • dot and dereference, 150

  • increment and dereference, 148

  • IO operator, 155

  • overloaded operator, 553

at

ate (file mode), 319

auto, 68, 78

auto_ptr deprecated, 471

automatic object, 205, 251

avg_price, Sales_data, 259