Skip to content

S

Sales_data

  • compareIsbn, 387

  • += (compound assignment), 564

  • + (addition), 560

  • == (equality), 561

  • != (inequality), 561

  • >> (input operator), 558

  • << (output operator), 557

  • add, 261

  • addition program, 74

  • avg_price, 259

  • bookstore program, 255

  • using algorithms, 406

  • class definition, 72, 268

  • combine, 259

  • compareIsbn, 425

  • with associative container, 426

  • constructors, 264266

  • converting constructor, 295

  • default constructor, 262

  • exception classes, 783

  • exception version

  • += (compound assignment), 784

  • + (addition), 784

  • explicit constructor, 296

  • isbn, 257

  • operations, 254

  • print, 261

  • read, 261

  • relational operators, 563

Sales_data.h header, 76

Sales_item, 20

  • + (addition), 22

  • >> (input operator), 21

  • << (output operator), 21

  • addition program, 21, 23

  • bookstore program, 24

  • isbn, 23

  • operations, 20

Sales_item.h header, 19

scientific manipulator, 757

scope, 48, 80

  • base class, 617

  • block, 48, 80, 173

  • class, 73, 282, 282287, 305

  • static member, 302

  • compared to object lifetime, 204

  • derived class, 617

  • friend, 270, 281

  • function, 204

  • global, 48, 80

  • inheritance, 617621

  • member function, 282

  • parameters and return type, 283

  • multiple inheritance, 807

  • name collisions, using directive, 795

  • namespace, 785790

  • nested class, 844

  • overloaded function, 234

  • statement, 174

  • template parameter, 668

  • template specialization, 708

  • using directive, 794

  • virtual function, 620

scoped enumeration, 832, 864

  • enum class, 832

Screen, 271

search, 872

search_n, 871

seed, random-number engine, 748

seekp, seekg, 763768

self-assignment

  • copy and swap assignment, 519

  • copy assignment, 512

  • explicit check, 542

c++
HasPtr
  • reference counted, 515

  • valuelike, 512

  • Message, 523

  • move assignment, 537

  • pitfalls, 512

  • StrVec, 528

semicolon (;), 3

  • class definition, 73

  • null statement, 172

separate compilation, 44, 80, 252

  • compiler options, 207

  • declaration vs. definition, 44

  • templates, 656

sequential container, 326, 373

set, 420, 448

set_difference, 880

set_intersection, 647, 880

set_symmetric_difference, 880

set_union, 880

setfill, manipulator, 759

setprecision, manipulator, 756

setstate, stream, 313

setw, manipulator, 758

shared_ptr, 450, 450457, 464469, 491

  • * (dereference), 451

  • copy and assignment, 451

  • definition, 450

  • deleter, 469, 491

  • bound at run time, 677

  • derived-to-base conversion, 630

  • destructor, 453

  • dynamically allocated array, 480

  • exception safety, 467

  • factory program, 453

  • initialization, 464

  • make_shared, 451

  • pitfalls, 469

  • reset, 466

  • StrBlob, 455

  • TextQuery class, 485

  • with new, 464

short, 33

short-circuit evaluation, 142, 169

  • && (logical AND), 142

  • || (logical OR), 142

  • not in overloaded operator, 553

ShorterString, 573

  • () (call operator), 573

shorterString, 224

showbase, manipulator, 755

showpoint, manipulator, 758

shrink_to_fit

shuffle, 878

signed, 34, 80

  • char, 34

  • conversion to unsigned, 34, 160

  • out-of-range value, 35

signed type, 34

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

size

size_t, 116, 132, 727

  • array subscript, 116

size_type, container, 88, 102, 132, 332

SizeComp, 573

  • () (call operator), 573

sizeof, 156, 169

sizeof..., parameter pack, 700

skipws, manipulator, 760

sliced, 603, 650

SmallInt

  • + (addition), 588

  • conversion operator, 580

smart pointer, 450, 491

  • exception safety, 467

  • pitfalls, 469

smatch, 729, 733, 769, 770

  • prefix, 736

  • provide context for a match, 735

  • suffix, 736

sort, 384, 876

source file, 4, 27

specialization, seetemplate specialization

splice, list, 416

splice_after, forward_list, 416

sregex_iterator, 733, 770

  • i before e program, 734

sstream

ssub_match, 733, 736, 770

stable_partition, 876

stable_sort, 387, 876

stack, 370, 373

stack unwinding, exception handling, 773, 818

standard error, 6, 27

standard header, #include, 6, 21

standard input, 6, 27

standard library, 5, 27

standard output, 6, 27

statement, 2, 27

statement label, 192

static (file static), 792, 817

static member

  • Account, 301

  • class template, 667

  • accessed through an instantiation, 667

  • definition, 667

  • const data member, initialization, 302

  • data member, 300

  • definition, 302

  • default argument, 304

  • definition, 302

  • inheritance, 599

  • instantiation, 667

  • member function, 301

  • nested class, 845

  • scope, 302

static object, local, 205, 252

static type, 601, 650

  • determines name lookup, 617, 619

  • multiple inheritance, 806

static type checking, 46

static_cast, 163, 163

  • lvalue to rvalue, 691

std, 7, 28

std::forward, seeforward

std::move, seemove

stdexcept header, 194, 197

stod, 368

stof, 368

stoi, 368

stol, 368

stold, 368

stoll, 368

store, free, 450, 491

stoul, 368

stoull, 368

str, string streams, 323

StrBlob, 456

StrBlobPtr, 474

  • ++ (increment), 566

  • -- (decrement), 566

  • * (dereference), 569

  • -> (arrow operator), 569

  • check, 474

  • constructor, 474

  • deref, 475

  • incr, 475

  • weak_ptr, 474

strcat, 123

strcmp, 123

strcpy, 123

stream

  • as condition, 15, 162, 312

  • clear, 313

  • explicit conversion to bool, 583

  • file marker, 765

  • flushing buffer, 314

  • format state, 753

  • istream_iterator, 403

  • iterator, 401, 403406, 418

  • type requirements, 406

  • not flushed if program crashes, 315

  • ostream_iterator, 403

  • random IO, 765

  • rdstate, 313

  • setstate, 313

strict weak ordering, 425, 448

string, 80, 8493, 132

string literal, 7, 28, 39

stringstream, 321, 321323, 324

  • initialization, 321

strlen, 122

struct

  • see alsoclass

  • default access specifier, 268

  • default inheritance specifier, 616

StrVec, 525

  • [] (subscript), 565

  • = (assignment), initializer_list, 563

  • alloc_n_copy, 527

  • begin, 526

  • capacity, 526

  • chk_n_alloc, 526

  • copy assignment, 528

  • copy constructor, 528

  • default constructor, 526

  • design, 525

  • destructor, 528

  • emplace_back, 704

  • end, 526

  • free, 528

  • memory allocation strategy, 525

  • move assignment, 536

  • move constructor, 535

  • push_back, 526

  • move-enabled, 545

  • reallocate, 530

  • move iterator version, 543

  • size, 526

subexpression, 770

subscript range, 93

substr, string, 361

suffix, smatch, 736

sum, program, 682

swap, 516

  • array, 339

  • container, 339

  • container nonmember version, 339

  • copy and swap assignment operator, 518

  • priority_queue, 371

  • queue, 371

  • stack, 371

  • typical implementation, 517518

swap program, 223

swap_ranges, 875

switch statement, 178, 178182, 200

  • default case label, 181

  • break, 179181, 190

  • compared to if, 178

  • execution flow, 180

  • variable definition, 182

syntax_option_type, regex, 730

synthesized

  • copy assignment, 500, 550

  • copy constructor, 497, 550

  • copy control, 267

  • as deleted function, 508

  • as deleted in derived class, 624

  • Bulk_quote, 623

  • multiple inheritance, 805

  • virtual base class, 815

  • virtual base classes, 815

  • volatile, 857

  • default constructor, 263, 306

  • derived class, 623

  • members of built-in type, 263

  • destructor, 503, 550

  • move operations

  • deleted function, 538

  • not always defined, 538