Preface |
|
xi | |
|
Building C++ Applications |
|
|
1 | (104) |
|
Obtaining and Installing GCC |
|
|
15 | (3) |
|
Building a Simple ``Hello, World'' Application from the Command Line |
|
|
18 | (5) |
|
Building a Static Library from the Command Line |
|
|
23 | (2) |
|
Building a Dynamic Library from the Command Line |
|
|
25 | (8) |
|
Building a Complex Application from the Command Line |
|
|
33 | (5) |
|
|
38 | (2) |
|
Building a Simple ``Hello, World'' Application Using Boost.Build |
|
|
40 | (4) |
|
Building a Static Library Using Boost.Build |
|
|
44 | (1) |
|
Building a Dynamic Library Using Boost.Build |
|
|
45 | (1) |
|
Building a Complex Application Using Boost.Build |
|
|
46 | (4) |
|
Building a Static Library with an IDE |
|
|
50 | (3) |
|
Building a Dynamic Library with an IDE |
|
|
53 | (4) |
|
Building a Complex Application with an IDE |
|
|
57 | (5) |
|
|
62 | (2) |
|
Building A Simple ``Hello, World'' Application with GNU make |
|
|
64 | (8) |
|
Building a Static Library with GNU Make |
|
|
72 | (5) |
|
Building a Dynamic Library with GNU Make |
|
|
77 | (1) |
|
Building a Complex Application with GNU make |
|
|
78 | (4) |
|
|
82 | (2) |
|
Specifying a Command-Line Option from Your IDE |
|
|
84 | (1) |
|
|
85 | (4) |
|
Producing a Release Build |
|
|
89 | (3) |
|
Specifying a Runtime Library Variant |
|
|
92 | (3) |
|
Enforcing Strict Conformance to the C++ Standard |
|
|
95 | (4) |
|
Causing a Source File to Be Linked Automatically Against a Specified Library |
|
|
99 | (2) |
|
|
101 | (4) |
|
|
105 | (15) |
|
Making Sure a Header File Gets Included Only Once |
|
|
107 | (1) |
|
Ensuring You Have Only One Instance of a Variable Across Multiple Source Files |
|
|
108 | (2) |
|
Reducing #includes with Forward Class Declarations |
|
|
110 | (1) |
|
Preventing Name Collisions with Namespaces |
|
|
111 | (7) |
|
|
118 | (2) |
|
|
120 | (19) |
|
Converting a String to a Numeric Type |
|
|
120 | (3) |
|
Converting Numbers to Strings |
|
|
123 | (3) |
|
Testing Whether a String Contains a Valid Number |
|
|
126 | (3) |
|
Comparing Floating-Point Numbers with Bounded Accuracy |
|
|
129 | (2) |
|
Parsing a String Containing a Number in Scientific Notation |
|
|
131 | (2) |
|
Converting Between Numeric Types |
|
|
133 | (3) |
|
Getting the Minimum and Maximum Values for a Numeric Type |
|
|
136 | (3) |
|
|
139 | (59) |
|
|
140 | (2) |
|
|
142 | (5) |
|
Storing Strings in a Sequence |
|
|
147 | (4) |
|
Getting the Length of a String |
|
|
151 | (2) |
|
|
153 | (1) |
|
|
154 | (3) |
|
|
157 | (2) |
|
Joining a Sequence of Strings |
|
|
159 | (3) |
|
Finding Things in Strings |
|
|
162 | (3) |
|
Finding the nth Instance of a Substring |
|
|
165 | (2) |
|
Removing a Substring from a String |
|
|
167 | (1) |
|
Converting a String to Lower- or Uppercase |
|
|
168 | (3) |
|
Doing a Case-Insensitive String Comparison |
|
|
171 | (2) |
|
Doing a Case-Insensitive String Search |
|
|
173 | (2) |
|
Converting Between Tabs and Spaces in a Text File |
|
|
175 | (3) |
|
Wrapping Lines in a Text File |
|
|
178 | (2) |
|
Counting the Number of Characters, Words, and Lines in a Text File |
|
|
180 | (3) |
|
Counting Instances of Each Word in a Text File |
|
|
183 | (2) |
|
Add Margins to a Text File |
|
|
185 | (3) |
|
|
188 | (2) |
|
Squeeze Whitespace to Single Spaces in a Text File |
|
|
190 | (1) |
|
Autocorrect Text as a Buffer Changes |
|
|
191 | (3) |
|
Reading a Comma-Separated Text File |
|
|
194 | (2) |
|
Using Regular Expressions to Split a String |
|
|
196 | (2) |
|
|
198 | (15) |
|
Obtaining the Current Date and Time |
|
|
198 | (3) |
|
Formatting a Date/Time as a String |
|
|
201 | (3) |
|
Performing Date and Time Arithmetic |
|
|
204 | (1) |
|
Converting Between Time Zones |
|
|
205 | (2) |
|
Determining a Day's Number Within a Given Year |
|
|
207 | (1) |
|
Defining Constrained Value Types |
|
|
208 | (5) |
|
Managing Data with Containers |
|
|
213 | (35) |
|
Using vectors Instead of Arrays |
|
|
214 | (4) |
|
Using vectors Efficiently |
|
|
218 | (4) |
|
|
222 | (2) |
|
Storing Pointers in a vector |
|
|
224 | (2) |
|
Storing Objects in a list |
|
|
226 | (5) |
|
Mapping strings to Other Things |
|
|
231 | (6) |
|
|
237 | (5) |
|
Storing Objects in Sorted Order |
|
|
242 | (3) |
|
Storing Containers in Containers |
|
|
245 | (3) |
|
|
248 | (37) |
|
Iterating Through a Container |
|
|
249 | (7) |
|
Removing Objects from a Container |
|
|
256 | (3) |
|
|
259 | (1) |
|
|
260 | (4) |
|
|
264 | (4) |
|
|
268 | (3) |
|
|
271 | (1) |
|
Performing Set Operations on Sequences |
|
|
272 | (4) |
|
Transforming Elements in a Sequence |
|
|
276 | (2) |
|
Writing Your Own Algorithm |
|
|
278 | (3) |
|
Printing a Range to a Stream |
|
|
281 | (4) |
|
|
285 | (45) |
|
Initializing Class Member Variables |
|
|
286 | (3) |
|
Using a Function to Create Objects (a.k.a. Factory Pattern) |
|
|
289 | (2) |
|
Using Constructors and Destructors to Manage Resources (for RAII) |
|
|
291 | (3) |
|
Automatically Adding New Class Instances to a Container |
|
|
294 | (2) |
|
Ensuring a Single Copy of a Member Variable |
|
|
296 | (1) |
|
Determining an Object's Type at Runtime |
|
|
297 | (2) |
|
Determining if One Object's Class Is a Subclass of Another |
|
|
299 | (2) |
|
Giving Each Instance of a Class a Unique Identifier |
|
|
301 | (2) |
|
Creating a Singleton Class |
|
|
303 | (3) |
|
Creating an Interface with an Abstract Base Class |
|
|
306 | (4) |
|
|
310 | (5) |
|
Writing a Member Function Template |
|
|
315 | (3) |
|
Overloading the Increment and Decrement Operators |
|
|
318 | (2) |
|
Overloading Arithmetic and Assignment Operators for Intuitive Class Behavior |
|
|
320 | (8) |
|
Calling a Superclass Virtual Function |
|
|
328 | (2) |
|
|
330 | (21) |
|
Creating an Exception Class |
|
|
330 | (5) |
|
Making a Constructor Exception-Safe |
|
|
335 | (3) |
|
Making an Initializer List Exception-Safe |
|
|
338 | (3) |
|
Making Member Functions Exception-Safe |
|
|
341 | (5) |
|
|
346 | (5) |
|
|
351 | (43) |
|
|
352 | (4) |
|
Formatting Floating-Point Output |
|
|
356 | (3) |
|
Writing Your Own Stream Manipulators |
|
|
359 | (4) |
|
Making a Class Writable to a Stream |
|
|
363 | (3) |
|
Making a Class Readable from a Stream |
|
|
366 | (2) |
|
Getting Information About a File |
|
|
368 | (2) |
|
|
370 | (4) |
|
Deleting or Renaming a File |
|
|
374 | (2) |
|
Creating a Temporary Filename and File |
|
|
376 | (2) |
|
|
378 | (2) |
|
|
380 | (3) |
|
Reading the Contents of a Directory |
|
|
383 | (2) |
|
Extracting a File Extension from a String |
|
|
385 | (1) |
|
Extracting a Filename from a Full Path |
|
|
386 | (2) |
|
Extracting a Path from a Full Path and Filename |
|
|
388 | (1) |
|
Replacing a File Extension |
|
|
389 | (1) |
|
Combining Two Paths into a Single Path |
|
|
390 | (4) |
|
|
394 | (52) |
|
Computing the Number of Elements in a Container |
|
|
395 | (1) |
|
Finding the Greatest or Least Value in a Container |
|
|
396 | (3) |
|
Computing the Sum and Mean of Elements in a Container |
|
|
399 | (3) |
|
Filtering Values Outside a Given Range |
|
|
402 | (1) |
|
Computing Variance, Standard Deviation, and Other Statistical Functions |
|
|
403 | (4) |
|
Generating Random Numbers |
|
|
407 | (2) |
|
Initializing a Container with Random Numbers |
|
|
409 | (1) |
|
Representing a Dynamically Sized Numerical Vector |
|
|
410 | (2) |
|
Representing a Fixed-Size Numerical Vector |
|
|
412 | (3) |
|
|
415 | (1) |
|
Computing the Norm of a Vector |
|
|
416 | (1) |
|
Computing the Distance Between Two Vectors |
|
|
417 | (2) |
|
Implementing a Stride Iterator |
|
|
419 | (4) |
|
Implementing a Dynamically Sized Matrix |
|
|
423 | (3) |
|
Implementing a Constant-Sized Matrix |
|
|
426 | (3) |
|
|
429 | (2) |
|
Computing the Fast Fourier Transform |
|
|
431 | (2) |
|
Working with Polar Coordinates |
|
|
433 | (2) |
|
Performing Arithmetic on Bitsets |
|
|
435 | (4) |
|
Representing Large Fixed-Width Integers |
|
|
439 | (4) |
|
Implementing Fixed-Point Numbers |
|
|
443 | (3) |
|
|
446 | (20) |
|
|
447 | (3) |
|
Making a Resource Thread-Safe |
|
|
450 | (8) |
|
Notifying One Thread from Another |
|
|
458 | (4) |
|
Initializing Shared Resources Once |
|
|
462 | (1) |
|
Passing an Argument to a Thread Function |
|
|
463 | (3) |
|
|
466 | (18) |
|
Hardcoding a Unicode String |
|
|
467 | (1) |
|
Writing and Reading Numbers |
|
|
468 | (4) |
|
Writing and Reading Dates and Times |
|
|
472 | (5) |
|
Writing and Reading Currency |
|
|
477 | (4) |
|
Sorting Localized Strings |
|
|
481 | (3) |
|
|
484 | (55) |
|
Parsing a Simple XML Document |
|
|
485 | (9) |
|
Working with Xerces Strings |
|
|
494 | (2) |
|
Parsing a Complex XML Document |
|
|
496 | (12) |
|
Manipulating an XML Document |
|
|
508 | (4) |
|
Validating an XML Document with a DTD |
|
|
512 | (5) |
|
Validating an XML Document with a Schema |
|
|
517 | (3) |
|
Transforming an XML Document with XSLT |
|
|
520 | (7) |
|
Evaluating an XPath Expression |
|
|
527 | (6) |
|
Using XML to Save and Restore a Collection of Objects |
|
|
533 | (6) |
|
|
539 | (16) |
|
Using Function Pointers for Callbacks |
|
|
539 | (2) |
|
Using Pointers to Class Members |
|
|
541 | (3) |
|
Ensuring That a Function Doesn't Modify an Argument |
|
|
544 | (2) |
|
Ensuring That a Member Function Doesn't Modify Its Object |
|
|
546 | (2) |
|
Writing an Operator That Isn't a Member Function |
|
|
548 | (2) |
|
Initializing a Sequence with Comma-Separated Values |
|
|
550 | (5) |
Index |
|
555 | |