A
Active Template Library (ATL) 572
alias templates
alignas specifier
uses 28
using, restrictions 26
almost always auto (AAA) 2
asserting
with Boost.Test 593, 594, 595, 596, 597
with Catch2 632, 633, 634, 635, 636, 637
with Google Test 613, 614, 615, 616, 617
asynchronous computations
used, for creating coroutine task type 681, 682, 683, 684, 685, 686, 691, 692
atomic types
using 434, 435, 436, 437, 438, 439, 440, 441, 442, 443
attorney-client idiom
friendship, handling with 567, 568, 570, 571
attributes
used, for providing metadata to compiler 212, 213, 214, 215, 216, 217
auto specifier
gotchas 5
B
behavior-driven development (BDD) 624
bidirectional iterators 268
binary files
objects, reading and writing from 345, 347, 348, 349, 350
objects, reading and writing to 345, 347, 348, 349, 350
raw data, reading and writing from 336, 337, 338, 339, 340, 341, 342, 343
raw data, reading and writing to 336, 337, 338, 339, 340, 341, 342, 343
bit manipulation utilities
bitset
using, for fixed-size sequences of bits 225, 226, 227, 228, 229
Boost library
URL 583
fixtures, using 597, 598, 599, 600, 601
outputs, controlling with 601, 603, 604, 605
tests, invoking with 587, 588, 589, 590, 591, 592, 593
tests, writing with 587, 588, 589, 590, 591, 592, 593
used, for asserting 593, 594, 595, 596, 597
branches
selecting, at compile time with constexpr if 208, 209, 210, 211, 212
C
C++17
list initialization rules 16, 17
calendars
working with 282, 283, 284, 285, 286
callable object
invoking, in uniform manner 186, 187, 188, 189
cancellation mechanisms 469, 470, 471, 473, 474
casts
used, for performing type conversions 511, 512, 513, 514, 515, 516
outputs, controlling with 637, 638, 639, 640, 641
tests, invoking with 627, 629, 630, 631
tests, writing with 627, 629, 630, 631
used, for asserting 632, 633, 634, 635, 636, 637
Catch2, reporters
automake reporter 641
SonarQube reporter 641
TeamCity reporter 641
Test Anything Protocol (TAP) reporter 641
chrono 278
classes
compiling, with enable_if 202, 203, 204, 205, 206
class template argument deduction 62
used, for simplifying code 62, 63, 64, 65
collections
iterating, with ranges library 668, 669, 671, 672, 673, 674
compile-time assertion checks
performing, with static_assert 199, 201
compile-time constant expressions
creating 502, 503, 504, 505, 506, 507
URL 505
compile time polymorphism 571
concatenating operator 196
constant correctness, program
benefits 497
ensuring 496, 498, 499, 500, 501
constant expression (constexpr) 502
const_cast conversion 501
constexpr if
about 208
used, for selecting branches at compile time 208, 209, 210, 211, 212
constinit specifier 506
constrained algorithms 674
container access
with non-member functions 270, 271, 272, 273, 275
content
removing, from files 382, 383, 384, 385
content of directory
contiguous sequences of objects
std**span, using for 316, 317, 318, 319
control class 555, 557, 558, 559, 561
conversion constructor 12
conversion operators
used, for avoiding implicit conversion 44, 45, 46, 47, 48, 49
cooked user-defined literals
copy-list-initialization 16
coroutine generator type
creating, for value sequence 692, 694, 695, 697, 698, 699, 700
coroutine task type
creating, for asynchronous computations 681, 682, 683, 684, 685, 686, 691, 692
functions, working 687, 688, 689, 690
cppcoro library 700
reference link 691
C-style casting (static casting) 513
curiously recurring template pattern (CRTP) 572, 579, 680
objects of types, implementing 575, 576
static polymorphism, with 571, 572, 573, 574, 575
custom types
hash values, generating for 295, 296, 297, 298
range-based for loops, enabling 39, 40, 41, 42, 43
D
default container
vector, using as 220, 221, 222, 223, 224, 225
defaulted functions 144, 145, 146, 147, 148
default member initialization 17, 21
deleted functions 144, 145, 146, 147, 148
digits constants
versus digits10 constants 78
direct initialization 10
direct-list-initialization 16
distributions 82
divide-and-conquer algorithm 462
double-checked locking pattern (DCLP) 578
dynamic extent 317
E
early binding 571
elements
finding, in range 240, 241, 242, 243, 244, 245
enable_if
classes, compiling with 202, 203, 204, 205, 206
functions, compiling with 202, 203, 204, 205, 206
entropy() method 81
enumerators 28
epoch 292
error handling
exceptions, using 484, 485, 486, 487, 488, 489, 490, 491
escaping characters
avoiding, raw string literals used 101, 102
exceptions
handling, from thread functions 415, 417, 418
used, for error handling 484, 485, 486, 487, 488, 489, 490, 491
existing directory
properties, checking 385, 386, 387, 388, 389
existing file
properties, checking 385, 386, 387, 388, 389
explicit constructors
used, for avoiding implicit conversion 44, 45, 46, 47, 48, 49
external linkage 51
F
factory patterns
if...else statements, avoiding in 546, 547, 548, 550
files
content, removing from 382, 383, 384, 385
files and directories
copying 377, 378, 379, 380, 381
creating 377, 378, 379, 380, 381
deleting 377, 378, 379, 380, 381
filesystem paths
working with 372, 373, 374, 375, 376
final special identifier
using, for virtual methods 32, 33, 34, 35, 36
fixtures
using, in Boost.Test 597, 598, 599, 600, 601
fold
implementing, with standard parallel algorithms 464, 465, 466, 467
implementing, with tasks 453, 454, 455, 456, 457, 460
implementing, with threads 444, 445, 446, 447, 448, 449, 451, 452
fold expressions
writing, to simplify variadic function templates 169, 170, 171, 172
format specifiers 137
format specifiers, chrono library
reference link 138
forward iterators 268
function execution time
measuring, with standard clock 290, 292, 293, 294
functions
compiling, with enable_if 202, 203, 204, 205, 206
composing, into higher-order function 182, 183, 184
executing, asynchronously 429, 430, 431, 432, 433
function template
writing, with variable number of arguments 163, 164, 165, 166, 167, 168
function, to be called
registering, on program exit 319, 321, 322
futures
values, returning from threads 426, 427, 428, 429
G
generator 692
generic lambda 7
generic lambdas
geometry module 649
Google Test 606, 607, 608, 609
outputs, controlling with 620, 622, 623
text fixtures, using with 617, 618, 619, 620
used, for asserting 613, 614, 615, 616, 617
Google.Test
tests, invoking with 610, 611, 612, 613
tests, writing with 610, 611, 612, 613
H
hash values
generating, for custom types 295, 296, 297, 298
higher-order function
functions, composing into 182, 183, 184
higher-order functions fold
implementing 174, 175, 176, 177, 178, 179
higher-order functions map
implementing 174, 175, 176, 177, 178, 179
Howard Hinnant's date library
reference link 282
human-readable format (HRF) 603
I
if...else statements
avoiding, in factory patterns 546, 547, 548, 550
immediate functions 508
implicit conversion
avoiding, with conversion operators 44, 45, 46, 47, 48, 49
avoiding, with explicit constructors 44, 46, 47, 48, 49
include 607
indirection pattern
using, for preprocessor concatenation 196, 197, 198, 199
using, for preprocessor stringification 196, 197, 198, 199
inline namespaces 53
used, for symbol versioning 53, 54, 55, 56
input iterators 268
Intel Advanced Vector Extensions (Intel AVX) 23
International Software Testing Qualifications Board (ISTQB) 608
I/O manipulators
using, to control output of stream 357, 358, 359, 360, 361, 362, 363, 364
iterator 695
iterators
used, for inserting elements into container 258, 259, 261
J
joinable threads
L
lambda closure 150
lambdas
using, with standard algorithms 149, 150, 151, 152, 153, 154
late binding 571
literal operators 88
localized settings
using, for streams 351, 352, 353, 354, 356
locks
access, synchronizing to shared data 405, 406, 407, 408, 409, 411
M
manipulators 357
memory ordering functions 441
reference link 440
merging 196
metadata
providing, to compiler with attributes 212, 213, 214, 215, 216, 217
module implementation partition 651
module interface unit (MIU) 645
module partitions 650, 652, 653
modules
advantages 644
working with 644, 645, 647, 648, 649, 650
monetary I/O manipulators
move semantics 529
implementing 529, 531, 532, 533, 534, 535
multi-return values
handling with structured bindings 57, 58, 59, 60, 61
mutable iterators 268
mutexes
access, synchronizing to shared data 405, 406, 407, 408, 409, 411
N
named parameter idiom 557
noexcept
benefits 495
exception specification rules 495
using, for functions that do not throw exceptions 491, 493, 494
non-member functions
for container access 270, 271, 272, 273, 275
non-static member initialization
non-virtual interface idiom
interfaces and implementations, separating with 562, 564, 566
notifications
sending, between threads 418, 419, 420, 421, 422, 423, 424, 425
nullable 306
numeric types
and string types, converting between 68, 69, 70, 71, 72, 73, 74
properties, querying 75, 76, 77, 78
O
object alignment
controlling 22, 24, 25, 26, 27, 28
querying 22, 23, 24, 25, 26, 27, 28
optional values
storing, with std**optional 303, 304, 305, 306, 307
output iterators 268
override special identifier
using, for virtual methods 32, 33, 34, 35, 36
own type traits
P
parallel map
implementing, with standard parallel algorithms 464, 465, 466, 467
implementing, with tasks 453, 454, 455, 456, 458, 459
implementing, with threads 444, 445, 446, 447, 448, 449, 451, 452
pimpl idiom
implementing 550, 552, 553, 555
plain old data (POD) 327
Plain Old Data (POD) type 13
pointer declarations 498
pointer to implementation (pimpl) 550
preprocessor concatenation
indirection pattern, using for 196, 197, 198, 199
preprocessor stringification
indirection pattern, using for 196, 197, 198, 199
promises
values, returning from threads 426, 427, 428, 429
promise_type 694
pseudo-random number generator
initializing, to produce uniformly distributed sequence of pseudo-random numbers 87, 88
pseudo-random number library , components
distributions 80
engines 80
pseudo-random numbers 79
generating 79, 80, 81, 82, 83, 84, 85, 86
R
random-access iterator
writing 261, 262, 263, 265, 267, 268
random access iterators 268
range
elements, finding in 240, 241, 242, 243, 244, 245
set operations, using on 253, 254, 255, 256, 257
sorting 246, 247, 248, 249, 250
range-based for loops 36
enabling, for custom types 39, 40, 41, 42, 43
used, for iterating on range 36, 37, 38, 39
ranges library
used, for iterating collections 668, 669, 671, 672, 673, 674
range-v3 library
reference link 674
range view
creating 675, 676, 678, 679, 680, 681
raw string literals
using, to avoid escaping characters 101, 102
raw user-defined literals
recursive lambda
recursive mutexes
regular expressions
reference link 110
structure 111
used, for parsing content of string 118, 119, 120, 121, 122, 123
used, for replacing content of string 124, 125, 126, 127
used, for verifying format of string 110, 111, 112, 113, 114, 115, 116, 118
regular expressions standard library
algorithms 117
classes 117
iterators 117
requires clauses
using 663, 664, 665, 666, 667, 668
requires expressions
using 663, 664, 665, 666, 667, 668
requires expressions, types
Compound requirements 668
Nested requirements 668
Simple requirements 667
Type requirements 668
requires keyword
working 667
resource acquisition is initialization (RAII) 488
Rule of Five 148
runtime polymorphism 571
run-time type information (RTTI) 511
S
scoped enumerations
set operations
using, on range 253, 254, 255, 256, 257
shared_ptr
used, for sharing memory resource 522, 524, 525, 527, 528, 529
source code
compiling, conditionally 192, 193, 194, 195, 196
spaceship operator (<=>) 536
implementing, guidelines 537
used, for comparison 535, 536, 537, 538, 540, 541, 542, 543
standard clock
used, for measuring function execution time 290, 292, 293, 294
standard exception classes
URL 491
standard literal operators 94
standard parallel algorithms
fold, implementing 464, 465, 466, 467
parallel map, implementing 464, 465, 466, 467
static_assert
compile-time assertion checks, performing with 199, 201
static extent 317
static members, of std**numeric_limits
versus C++ macros 77
static polymorphism
about 571
with curiously recurring template pattern (CRTP) 571, 572, 573, 574, 575
std**any
used, for storing any value 299, 300, 301, 302
std**chrono**duration class
used, for expressing time intervals 278, 279, 280, 281
std**conditional
using, to select between types 331, 332, 333, 334
std**format
used for formatting text 131, 132, 133, 134, 135, 137, 138
using, with user-defined types 138, 139, 141, 142
std**initializer_list
used, for way initialization 14
std//invoke() function 186
std**numeric_limits<T>
using 75
working 76
std**optional
used, for storing optional values 303, 304, 305, 306, 307
std**runtime_error 489
std**span
using, for contiguous sequences of objects 316, 317, 318, 319
std**variant
about 311, 312, 313, 314, 315, 316
using, as type-safe union 308, 309, 310
Streaming SIMD Extensions (SSE) 23
stream, output
controlling, with I/O manipulators 357, 358, 359, 360, 361, 362, 363, 364
streams
localized settings, using for 351, 352, 353, 354, 356
string content
parsing, regular expression used 118, 119, 120, 121, 122, 123
replacing, regular expression used 124, 125, 126, 127
string format
verifying, with regular expressions 110, 111, 112, 113, 114, 115, 117, 118
string helpers
library, implementing 103, 104, 105, 106, 107, 108, 109
stringizing operator 196
string to number (ston) format 70
string_view
using, instead of constant string references 127, 128, 129, 130, 131
structured bindings 57
used, for handling multi-return values 57, 59, 60, 61
subroutines 687
substitution failure is not an error (SFINAE) 202
symbol versioning
inline namespaces, using 53, 54, 55, 56
T
tasks
fold, implementing 453, 454, 455, 456, 457, 458, 459
parallel map, implementing 453, 454, 455, 456, 457, 458, 459
template arguments
requisites, specifying with concepts 657, 658, 659, 660, 661, 662, 663
template lambdas
template metaprogramming 657
template method 564
Test Anything Protocol (TAP) reporter 641
test case 608
test context 597
Test library
Test library, variants
shared library 584
single header 584
static library 584
text fixtures
using, with Google Test 617, 618, 619, 620
thread functions
exceptions, handling from 415, 417, 418
threads
fold, implementing 444, 445, 446, 447, 448, 449, 451, 452
notifications, sending between 418, 419, 420, 421, 422, 423, 424, 425
parallel map, implementing 444, 445, 446, 447, 448, 449, 451, 452
working with 400, 401, 402, 403, 404, 405
thread-safe singleton
implementing 576, 577, 578, 579, 580
thread synchronization mechanisms
using 474, 475, 477, 478, 479, 480, 481
time intervals
expressing, with std**chrono**duration class 278, 279, 280, 281
time I/O manipulators
times
converting, between time zones 287, 288, 289
token-pasting 196
trim 675
trim_view class
working 680
type aliases
type casts
performing 510, 511, 512, 513, 514, 515
typedef-name 9
type-safe union
std**variant, using as 308, 309, 310
type traits
using, to query properties of types 323, 324, 325, 326
U
uniform initialization 10, 11, 12, 13, 14, 15, 16
unique_ptr
used, for owning memory resource 516, 517, 518, 519, 520, 521, 522
units in the last place (ULP) 615
Universal Naming Convention (UNC) 375
unnamed namespaces
using, instead of static globals 49, 51, 52
unscoped enumerations 28
issues 30
user-defined conversion functions 44
user-defined literals
cooked 89
raw 89
user-defined types
std**format, using with 138, 139, 141
V
value categories
reference link 667
value sequence
used, for creating coroutine generator type 692, 694, 695, 697, 698, 699, 700
variadic functions 163
variadic function templates 163
simplifying, with fold expressions 169, 170, 171, 172
vector
benefits 223
using, as default container 220, 221, 222, 223, 224, 225
vector<bool>
using, for variable-size sequences of bits 232, 233, 236
virtual methods
final special identifier, using 32, 33, 34, 35, 36
override special identifier, using 32, 33, 34, 35, 36
W
Windows Template Library (WTL) 572
18.189.2.122