Skip to content

P

pair, 426, 448

  • default initialization, 427

  • definition, 426

  • initialization, 426

  • list initialization, 427, 431, 527

  • make_pair, 428

  • map, * (dereference), 429

  • operations, 427

  • public data members, 427

  • return value, 527

Panda, 803

parameter, 202, 208, 252

parameter list

parameter pack, 714

parentheses, override precedence, 136

partial_sort, 877

partial_sort_copy, 877

partial_sum, 882

partition, 876

partition_copy, 876

partition_point, 876

pass by reference, 208, 210, 252

pass by value, 209, 252

  • uses copy constructor, 498

  • uses move constructor, 539

pattern, 702, 714

  • function parameter pack, 704

  • regular expression, phone number, 739

  • template parameter pack, 703

peek, istream, 761

PersonInfo, 321

phone number, regular expression

pitfalls

  • dynamic memory, 462

  • order of evaluation, 149

  • self-assignment, 512

  • smart pointer, 469

  • using directive, 795

placeholders, 399

placement new, 460, 491, 824, 863

  • union, class type member, 851

plus<T>, 575

pointer, 52, 5258, 79

  • ++ (increment), 118

  • -- (decrement), 118

  • * (dereference), 53

  • [] (subscript), 121

  • = (assignment), 55

  • + (addition), 119

  • - (subtraction), 119

  • == (equality), 55, 120

  • != (inequality), 55, 120

  • and array, 117

  • arithmetic, 119, 132

  • const, 63, 78

  • const pointer to const, 63

  • constexpr, 67

  • conversion

  • from array, 161

  • to bool, 162

  • to const, 62, 162

  • to void*, 161

  • dangling, 463, 491

  • declaration style, 57

  • definition, 52

  • delete, 460

  • derived-to-base conversion, 597

  • under multiple inheritance, 805

  • dynamic_cast, 825

  • implicit this, 257, 306

  • initialization, 5254

  • invalid, 52

  • multidimensional array, 128

  • null, 53, 79

  • off-the-end, 118

  • parameter, 209, 214

  • relational operators, 123

  • return type, 204

  • return value, local variable, 225

  • smart, 450, 491

  • to const, 62

  • and typedef, 68

  • to array

  • parameter, 218

  • return type, 204

  • return type declaration, 229

  • to const, 79

  • overloaded parameter, 232, 246

  • to pointer, 58

  • typeid operator, 828

  • valid, 52

  • volatile, 856

pointer to function, 247250

  • auto, 249

  • callable object, 388

  • decltype, 249

  • exception specification, 779, 781

  • explicit template argument, 686

  • function template instantiation, 686

  • linkage directive, 859

  • overloaded function, 248

  • parameter, 249

  • return type, 204, 249

  • using decltype, 250

  • template argument deduction, 686

  • trailing return type, 250

  • type alias, 249

  • typedef, 249

pointer to member, 835, 863

  • arrow (->*), 837

  • definition, 836

  • dot (.*), 837

  • function, 838

  • and bind, 843

  • and function, 842

  • and mem_fn, 843

  • not callable object, 842

  • function call, 839

  • function table, 840

  • precedence, 838

polymorphism, 605, 650

pop

pop_back

  • sequential container, 348

  • StrBlob, 457

pop_front, sequential container, 348

portable, 854

precedence, 134, 136137, 169

  • = (assignment), 146

  • ?: (conditional operator), 151

  • assignment and relational operators, 146

  • dot and dereference, 150

  • increment and dereference, 148

  • of IO operator, 156

  • overloaded operator, 553

  • parentheses overrides, 136

  • pointer to member and call operator, 838

precedence table, 166

precision member, ostream, 756

predicate, 386, 418

prefix, smatch, 736

preprocessor, 76, 79

  • #include, 7

  • assert macro, 241, 251

  • header guard, 77

  • variable, 54, 79

prev_permutation, 879

print, Sales_data, 261

print program

  • array parameter, 215

  • array reference parameter, 217

  • pointer and size parameters, 217

  • pointer parameter, 216

  • two pointer parameters, 216

  • variadic template, 701

print_total

PrintString, 571

  • () (call operator), 571

priority_queue, 371, 373

private

  • access specifier, 268, 306

  • copy constructor and assignment, 509

  • inheritance, 612, 650

program

  • addition

  • Sales_data, 74

  • Sales_item, 21, 23

  • alternative_sum, 682

  • biggies, 391

  • binops desk calculator, 577

  • book from author version 1, 438

  • book from author version 2, 439

  • book from author version 3, 440

  • bookstore

  • Sales_data, 255

  • Sales_data using algorithms, 406

  • Sales_item, 24

  • buildMap, 442

  • children’s story, 383391

  • compare, 652

  • count_calls, 206

c++
debug_rep
  • additional nontemplate versions, 698

  • general template version, 695

  • nontemplate version, 697

  • pointer template version, 696

elimDups, 383391

error_msg, 221

fact, 202

factorial, 227

factory

  • new, 461

  • shared_ptr, 453

  • file extension, 730

  • version 2, 738

  • find last word, 408

  • find_char, 211

  • findBook, 721

  • flip, 694

  • flip1, 692

  • flip2, 693

  • grade clusters, 103

  • grading

  • bitset, 728

  • bitwise operators, 154

  • i before e, 729

  • version 2, 734

  • isShorter, 211

  • letter grade, 175

  • make_plural, 224

  • message handling, 519

  • phone number

  • istringstream, 321

  • ostringstream, 323

  • reformat, 742

  • regular expression version, 738

  • valid, 740

c++
print
  • array parameter, 215

  • array reference parameter, 217

  • pointer and size parameters, 217

  • pointer parameter, 216

  • two pointer parameters, 216

  • variadic template, 701

  • print_total, 593

  • Query, 635

  • class design, 636639

  • random IO, 766

c++
reset
  • pointer parameters, 209

  • reference parameters, 210

  • restricted word_count, 422

  • sum, 682

  • swap, 223

  • TextQuery, 486

  • design, 485

  • transform, 442

  • valid, 740

  • vector capacity, 357

  • vowel counting, 179

c++
word_count

promotion, see integral promotion

protected

ptr_fun deprecated, 401

ptrdiff_t, 120, 132

public

pure virtual function, 609, 650

  • Disc_quote, 609

  • Query_base, 636

push

push_back

push_front

  • front_inserter, 402

  • sequential container, 342

put, istream, 761

putback, istream, 761