Exploring C++: The Programmer's Introduction to C++The following lists all the code examples from the book (with one deliberate omission—see Exploration 1 for details). A number of projects develop over the course of an exploration or multiple explorations. See the final versions of these files. See also the projects.
for Loop to Print Ten Non-negative Numbers
rational Type
reduce Member Function
assign Member Function
rational Object
reduce Member Function to Accept a Negative Denominator
inline for Trivial Functions
< Operator for rational
> and >= Operators in Terms of <
rational Comparison Operators
rational Type
rational Type
vector from Two Read Iterators
const Modifier to print
const Member Functions for Class point
const and Non-const Member Functions
print Function to Every Class Derived from work
print Function
work
movie
movie Class
print Member Function to the movie Class
work as an Abstract Class.
rational Class with inline Member Functions
generate_id to Demonstrate Static Variables
counter Outside of the generate_id Function
generate_id's Members in generate_id.cpp
main Function for the ID-generating Program in the main.cpp file
#include File for the generate_id Class
#include the generate_id.hpp File
#include the generate_id.hpp file
vital_stats Class to Record a Person's Vital Statistics
generate_id to Use the Function Call Operator
generate_id Function Call Operator
generate_id Object's Function Call Operator
sanitize Function to Make Use of Function Objects
sanitize Function as a Function Object
mem_fun_ref
intrange to Test Whether an Integer Lies Within a Certain Range
find_if and intrange to Find an Integer That Lies Within a Range
lower_bound and upper_bound Functions
replace_if and intrange to Replace All Integers in [10, 20] with 0
reverse_iterator
erase with a const_iterator
string to Throw Exceptions
reduce()
search Function Without Using the Comma Operator
rational
rational Class Definition
absval Function Template
copy Algorithm
find Algorithm
std::min Algorithm
gcd Function Template
point Class Template
move_by Member Function
rational Class Template
rational Class Template
rational Comparison Operator
rational Base Types
point Class Template
point<int> Specialization
point<double> and Testing the Code
std::less to Compare person Objects by Name
std::less Class Template
numeric_limits for the rational Class
std::pair Class Template
pair<> for Two void Arguments
pair for One void Argument
pair for the Other void Argument
fixed from a Class to a Class Template
fixed for N == 0
rational Class Template in the numeric Namespace
fixed Class Template in the numeric Namespace
parser Namespace
hash Template for the rational Type
erase_less Function Template
array
deque
list
vector
set
std::less
unordered_set
ctype Facet
from_string Function Extracts a Value from a String
to_string Function Converts a Value to a String
to_string as a Template Function
to_string
to_string
to_string
from_string by Adding Some Error-Checking
list Class Template
list::push_back and list::pop_back
artifact Class
expand Function
parse_graph
auto_ptr Class Template
auto_ptr in bomb
auto_ptr
auto_ptr Object (Or Not)
auto_ptr Objects
shared_ptr
artifact Pimpl Wrapper Class
artifact Class
artifact Value Class
setf Member Function
setf Function
std::bitset
find_pair Function and Test Program
language Class with Error-Checked Successor Functions
language Class
card Class with Enumerations
HashableString Class
HashableString That Derives from std::string
hash<> Class Template
string_pool to Use hash<>
assignment_mixin Class Template
mix-in Class Template
comparison_mixin and equality_mixin Class Templates
thing Class with All of Its Mix-ins.
std::advance
my_advance Function
iterator_advancer for Random Access Iterators
newstring Class Template
vector_storage Class Template
deque_storage Class Template
array_storage Class Template
array_storage Class Template, Based on array<>
newstring
abs for rational Arguments
abs(rational<integer>)
abs to Take Advantage of a Using Declaration
base Class Name
fixed Class Template
power10 Class Template
power10 Class Template
fixed Class Template
vector's insert Function