Skip to content

C

.C file, 4

.cc file, 4

.cpp file, 4

.cp file, 4

C library header, 91

C-style cast, 164

C-style string, 114, 122, 122123, 131

  • buffer overflow, 123

  • initialization, 122

  • parameter, 216

  • string, 124

c_str, 124

call by reference, 208, 210, 251

call by value, 209, 251

  • uses copy constructor, 498

  • uses move constructor, 539

call signature, 576, 590

callable object, 388, 417, 571572

  • absInt, 571

  • bind, 397

  • call signature, 576

  • function and function pointers, 388

  • function objects, 572

  • pointer to member

  • and bind, 843

  • and function, 842

  • and mem_fn, 843

  • not callable, 842

  • PrintString, 571

  • ShorterString, 573

  • SizeComp, 573

  • with function, 576579

  • with algorithms, 390

candidate function, 243, 251

capacity

capture list, seelambda expression

case label, 179, 179182, 199

  • default, 181

  • constant expression, 179

case sensitive, string, 365

cassert header, 241

cast, see alsonamed cast, 168

catch, 193, 195, 199, 775, 816

catch all (catch(...)), 777, 816

caution

  • ambiguous conversion operator, 581

  • conversions to unsigned, 37

  • dynamic memory pitfalls, 462

  • exception safety, 196

  • IO buffers, 315

  • overflow, 140

  • overloaded operator misuse, 555

  • overloaded operators and conversion operators, 586

  • smart pointer, pitfalls, 469

  • uninitialized variables, 45

  • using directives cause pollution, 795

cbegin

cctype

cend

cerr, 6, 26

chained input, 8

chained output, 7

char, 32

  • signed, 34

  • unsigned, 34

  • array initialization, 114

  • literal, 39

  • representation, 34

char16_t, 33

char32_t, 33

character

  • newline (\n), 39

  • nonprintable, 39, 79

  • null (\0), 39

  • tab (\t), 39

character string literal, seestring literal

check

check_size, 398

checked cast, seedynamic_cast

children’s story program, 383391

chk_n_alloc, StrVec, 526

cin, 6, 26

  • tied to cout, 315

cl, 5

class, 19, 26, 72, 305

class

  • compared to typename, 654

  • default access specifier, 268

  • default inheritance specifier, 616

  • template parameter, 654

class derivation list, 596

  • access control, 612

  • default access specifier, 616

  • direct base class, 600

  • indirect base class, 600

  • multiple inheritance, 803

  • virtual base class, 812

class template, 96, 131, 658, 659, 658667, 713

class type, 19, 26

  • conversion, 162, 305, 590

  • ambiguities, 587

  • conversion operator, 579

  • converting constructor, 294

  • impact on function matching, 584

  • overloaded function, 586

  • with standard conversion, 581

  • default initialization, 44

  • initialization, 73, 84, 262

  • union member of, 848

  • variable vs. function declaration, 294

clear

  • sequential container, 350

  • stream, 313

clog, 6, 26

close, file stream, 318

cmatch, 733

cmath header, 751, 757

collapsing rule, reference, 688

combine, Sales_data, 259

comma (,) operator, 157

comment, 9, 26

  • block (/* */), 9, 26

  • single-line (//), 9, 26

compare

  • default template argument, 670

  • function template, 652

  • default template argument, 670

  • explicit template argument, 683

  • specialization, 706

  • string literal version, 654

  • template argument deduction, 680

  • string, 366

compareIsbn

  • and associative container, 426

  • Sales_data, 387

compilation

  • common errors, 16

  • compiler options, 207

  • conditional, 240

  • declaration vs. definition, 44

  • mixing C and C++, 860

  • needed when class changes, 270

  • templates, 656

  • error detection, 657

  • explicit instantiation, 675676

compiler

  • extension, 114, 131

  • GNU, 5

  • Microsoft, 5

  • options for separate compilation, 207

composition vs. inheritance, 637

compound assignment (e.g., +=)

  • arithmetic operators, 147

  • bitwise operators, 147

compound expression, seeexpression

compound statement, 173, 199

compound type, 50, 5058, 78

  • array, 113

  • declaration style, 57

  • understanding complicated declarations, 115

concatenation

  • string, 89

  • string literal, 39

condition, 12, 26

  • = (assignment) in, 146

  • conversion, 159

  • do while statement, 189

  • for statement, 13, 185

  • if statement, 18, 175

  • in IO expression, 156

  • logical operators, 141

  • smart pointer as, 451

  • stream type as, 15, 162, 312

  • while statement, 12, 183

condition state, IO classes, 312, 324

conditional compilation, 240

conditional operator (?:), 151

connection, 468

console window, 6

const, 59, 78

  • and typedef, 68

  • conversion, 162

  • template argument deduction, 679

  • dynamically allocated

  • destruction, 461

  • initialization, 460

  • initialization, 59

  • class type object, 262

  • low-level const, 64

  • argument and parameter, 213

  • conversion from, 163

  • conversion to, 162

  • overloaded function, 232

  • template argument deduction, 693

  • member function, 258, 305

  • () (call operator), 573

  • not constructors, 262

  • overloaded function, 276

  • reference return, 276

  • parameter, 212

  • function matching, 246

  • overloaded function, 232

  • pointer, 63, 78

  • pointer to, 62, 79

  • conversion from nonconst, 162

  • initialization from nonconst, 62

  • overloaded parameter, 232

  • reference, seereference to const

  • top-level const, 64

  • and auto, 69

  • argument and parameter, 212

  • decltype, 71

  • parameter, 232

  • template argument deduction, 679

  • variable, 59

  • declared in header files, 76

  • extern, 60

  • local to file, 60

const_cast, 163, 163

const_iterator, container, 108, 332

const_reference, container, 333

const_reverse_iterator, container, 332, 407

constant expression, 65, 78

  • array dimension, 113

  • bit-field, 854

  • case label, 179

  • enumerator, 833

  • integral, 65

  • nontype template parameter, 655

  • sizeof, 156

  • static data member, 303

constexpr, 66, 78

  • constructor, 299

  • declared in header files, 76

  • function, 239, 251

  • nonconstant return value, 239

  • function template, 655

  • pointer, 67

  • variable, 66

construct

  • allocator, 482

  • forwards to constructor, 527

constructor, 262, 264, 262266, 305

container, 96, 131, 326, 372

continue statement, 191, 199

control, flow of, 11, 172, 200

conversion, 78, 159, 168

  • = (assignment), 145, 159

  • ambiguous, 583589

  • argument, 203

  • arithmetic, 35, 159, 168

  • array to pointer, 117

  • argument, 214

  • exception object, 774

  • multidimensional array, 128

  • template argument deduction, 679

  • base-to-derived, not automatic, 602

  • bool, 35

  • class type, 162, 294, 305, 590

  • ambiguities, 587

  • conversion operator, 579

  • function matching, 584, 586

  • with standard conversion, 581

  • condition, 159

  • derived-to-base, 597, 649

  • accessibility, 613

  • key concepts, 604

  • shared_ptr, 630

  • floating-point, 35

  • function to pointer, 248

  • exception object, 774

  • template argument deduction, 679

  • integral promotion, 160, 169

  • istream, 162

  • multiple inheritance, 805

  • ambiguous, 806

  • narrowing, 43

  • operand, 159

  • pointer to bool, 162

  • rank, 245

  • return value, 223

  • Sales_data, 295

  • signed type, 160

  • signed to unsigned, 34

  • to const, 162

  • from pointer to nonconst, 62

  • from reference to nonconst, 61

  • template argument deduction, 679

  • unscoped enumeration to integer, 834

  • unsigned, 36

  • virtual base class, 812

conversion operator, 580, 580587, 590

converting constructor, 294, 305

  • function matching, 585

  • with standard conversion, 580

_copy algorithms, 383, 414

copy, 382, 874

copy and swap assignment, 518

  • move assignment, 540

  • self-assignment, 519

copy assignment, 500501, 549

  • = default, 506

  • = delete, 507

  • base from derived, 603

  • copy and swap, 518, 549

  • derived class, 626

c++
HasPtr
  • reference counted, 516

  • valuelike, 512

  • memberwise, 500

  • Message, 523

  • preventing copies, 507

  • private, 509

  • reference count, 514

  • rule of three/five, 505

  • virtual destructor exception, 622

  • self-assignment, 512

  • StrVec, 528

  • synthesized, 500, 550

  • deleted function, 508, 624

  • derived class, 623

  • multiple inheritance, 805

  • union with class type member, 852

  • valuelike class, 512

copy constructor, 496, 496499, 549

  • = default, 506

  • = delete, 507

  • base from derived, 603

  • derived class, 626

c++
HasPtr
  • reference counted, 515

  • valuelike, 512

  • memberwise, 497

  • Message, 522

  • parameter, 496

  • preventing copies, 507

  • private, 509

  • reference count, 514

  • rule of three/five, 505

  • virtual destructor exception, 622

  • StrVec, 528

  • synthesized, 497, 550

  • deleted function, 508, 624

  • derived class, 623

  • multiple inheritance, 805

  • union with class type member, 851

  • used for copy-initialization, 498

copy control, 267, 496, 549

  • = delete, 507508

  • inheritance, 623629

  • memberwise, 267, 550

  • copy assignment, 500

  • copy constructor, 497

  • move assignment, 538

  • move constructor, 538

  • multiple inheritance, 805

  • synthesized, 267

  • as deleted function, 508

  • as deleted in derived class, 624

  • move operations as deleted function, 538

  • unions, 849

  • virtual base class, synthesized, 815

copy initialization, 84, 131, 497, 497499, 549

  • array, 337

  • container, 334

  • container elements, 342

  • explicit constructor, 498

  • invalid for arrays, 114

  • move vs. copy, 539

  • parameter and return value, 498

  • uses copy constructor, 497

  • uses move constructor, 541

copy_backward, 875

copy_if, 874

copy_n, 874

copyUnion, Token, 851

count, reference, 550

count

count_calls, program, 206

count_if, 871

cout, 6, 26

  • tied to cin, 315

cplusplus_primer, namespace, 787

crbegin, container, 333

cref, binds reference parameter, 400, 417

cregex_iterator, 733, 769

crend, container, 333

cstddef header, 116, 120

cstdlib header, 54, 227, 778, 823

cstring

csub_match, 733, 769

ctime header, 749

curly brace, 2, 26