C++ in a Nutshell: A Desktop Quick Reference

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

To-the-point, authoritative, no-nonsense solutions have always been a trademark of O'Reilly books. The In a Nutshell books have earned a solid reputation in the field as the well-thumbed references that sit beside the knowledgeable developer's keyboard. C++ in a Nutshell lives up to the In a Nutshell promise. C++ in a Nutshell is a lean, focused reference that offers practical examples for the most important, most often used, aspects of C++. C++ in a Nutshell packs an enormous amount of information on C++ (and the many libraries used with it) in an indispensable quick reference for those who live in a deadline-driven world and need the facts but not the frills. The book's language reference is organized first by topic, followed by an alphabetical reference to the language's keywords, complete with syntax summaries and pointers to the topic references. The library reference is organized by header file, and each library chapter and class declaration presents the classes and types in alphabetical order, for easy lookup. Cross-references link related methods, classes, and other key features. This is an ideal resource for students as well as professional programmers. When you're programming, you need answers to questions about language syntax or parameters required by library routines quickly. What, for example, is the C++ syntax to define an alias for a namespace? Just how do you create and use an iterator to work with the contents of a standard library container? C++ in a Nutshell is a concise desktop reference that answers these questions, putting the full power of this flexible, adaptable (but somewhat difficult to master) language at every C++ programmer's fingertips.

Author(s): Ray Lischner
Publisher: O'Reilly Media
Year: 2003

Language: English
Pages: 810

Table of Contents
Preface
Structure of This Book
About the Examples
Conventions Used in This Book
For More Information
Comments and Questions
Acknowledgments
Language Basics
Compilation Steps
Tokens
Identifiers
Keywords
Literals
Integer literals
Floating-point literals
Boolean literals
Character literals
String literals
Symbols
Comments
Character Sets
Alternative Tokens
Trigraphs
Declarations
Declarations and Definitions
Definitions
Ambiguity
Scope
Name Lookup
Qualified Name Lookup
Unqualified Name Lookup
Argument-Dependent Name Lookup
Linkage
Scope Linkage
Language Linkage
Type Declarations
Fundamental Types
Enumerated Types
POD Types
typedef Declarations
Elaborated Type Specifier
Object Declarations
Specifiers
Storage class specifiers
const and volatile qualifiers
Type specifiers
Using specifiers
Declarators
Arrays
Pointers
Function pointers
Member pointers
References
Initializers
Function-like initializers
Assignment-like initializers
Initializing arrays
Initializing scalars
Object Lifetime
Namespaces
Namespace Definitions
Namespace Aliases
using Declarations
using Directives
How to Use Namespaces
Expressions
Lvalues and Rvalues
Type Conversions
Arithmetic Types
Type Promotion
Arithmetic Type Conversions
Implicit Numeric Conversions
Lvalue Conversions
Conversion to bool
Type Casts
Constant Expressions
Integral Constant Expressions
Null Pointers
Expression Evaluation
Sequence Points
Order of Evaluation
Short-Circuit Evaluation
Expression Rules
Primary Expressions
Postfix Expressions
Unary Expressions
Cast Expressions
Pointer-to-Member Expressions
Multiplicative Expressions
Additive Expressions
Shift Expressions
Relational Expressions
Equality Expressions
Bitwise And Expressions
Bitwise Exclusive Or Expressions
Bitwise Inclusive Or Expressions
Logical And Expressions
Logical Or Expressions
Conditional Expressions
Assignment Expressions
Comma Expressions
Statements
Expression Statements
Declarations
Declaration Statements
Condition Declarations
Compound Statements
Selections
if Statements
switch Statements
Loops
while Statements
for Statements
do Statements
Control Statements
Handling Exceptions
Functions
Function Declarations
Return Type
Parameters
Default Arguments
Variable Number of Arguments
cv-qualifiers
Exception Specifications
Function Definitions
Declarations and Definitions
Function Types and Signatures
Function Bodies and try Blocks
Function Overloading
Declaring Overloaded Functions
Calling Overloaded Functions
Candidate Functions
Qualified member function call
Unqualified function call
Operator
Function-like initialization
Assignment-like initialization
Conversion initialization
Reference bound to conversion
Addresses of Overloaded Functions
Best Overloaded Function
Pruning the candidate list
Choosing the best function
Argument conversion sequences
Operator Overloading
Short-Circuit Operators
Comma Operator
Increment and Decrement
Member Reference
Function Call
operator new and operator delete
Type Conversion
The main Function
Classes
Class Definitions
Plain Old Data
Trivial Classes
Unions
Local Classes
Data Members
Data Layout
Mutable Data Members
Bit-Fields
Static Data Members
Member Functions
Pointers-to-Members
this Pointer
Static Member Functions
Constructors
Declaring constructors
Special constructors
Calling constructors
Throwing exceptions during construction
Destructors
Implicit Member Functions
Implicit default constructor
Implicit copy constructor
Implicit copy assignment operator
Implicit destructor
Inheritance
Virtual Functions
Covariant Return Types
Pure Virtual Functions
Abstract Classes
Multiple Inheritance
Virtual Inheritance
Polymorphic Constructors and Destructors
Access Specifiers
Friends
Nested Types
Templates
Overview of Templates
Template Declarations
Function Templates
Function Signatures
Deducing Argument Types
Overloading
Operators
Class Templates
Member Templates
Friends
Specialization
Partial Specialization
Instantiation
Name Lookup
Dependent Names
Resolving Names
Hiding Names
Using Type Names
Tricks with Templates
Compiling Templates
Standard Library
Overview of the Standard Library
C Library Wrappers
Wide and Multibyte Characters
Wide Characters
Multibyte Characters
Shift State
Traits and Policies
Character Traits
Iterator Traits
Custom Traits
Allocators
Using Allocators
Custom Allocators
Numerics
Input and Output
Introduction to I/O Streams
Custom I/O Operators
The C Standard I/O Library
C++ I/O Headers
Text I/O
Formatted Input
Formatted Output
Binary I/O
Stream Buffers
Manipulators
Standard Manipulators
Custom Manipulators
Errors and Exceptions
Containers, Iterators, and Algorithms
Containers
Standard Containers
Container Adapters
Pseudo-Containers
Container Requirements
Member types
Member functions
Exceptions
Using Containers
Value type requirements
Inserting values
Erasing values
Searching
Iterators
Iterator Categories
Iterator Safety
Special Iterators
Custom Iterators
const_iterators
Reverse Iterators
Algorithms
How Algorithms Work
Standard Algorithms
Nonmodifying operations
Comparison
Searching
Binary search
Modifying sequence operations
Sorting
Merging
Set operations
Heap operations
Permutations
Custom Algorithms
Preprocessor Reference
# operator and directive
## operator
#define directive
defined operator
#elif directive
#else directive
#endif directive
#error directive
#if directive
Examples
#ifdef directive
#ifndef directive
#include directive
#line directive
#pragma directive
#undef directive
Language Reference
and operator
and_eq operator
asm definition
auto storage class
bitand operator
bitor operator
bool type
break statement
case keyword
catch keyword
char type
class keyword
compl operator
const qualifier
const_cast operator
continue statement
declaration
declarator
default keyword
delete operator
do statement
double type
dynamic_cast operator
else keyword
enum keyword
explicit specifier
export specifier
expression
extern storage class
false literal
float type
for statement
friend specifier
function
goto statement
identifier
if statement
inline specifier
int type
long type
mutable specifier
namespace keyword
new operator
not operator
not_eq operator
operator keyword
or operator
or_eq operator
private access specifier
protected access specifier
public access specifier
register storage class
reinterpret_cast operator
return statement
short type
signed specifier
sizeof operator
statement
static storage class
static_cast operator
struct keyword
switch statement
template keyword
this keyword
throw operator
true literal
try statement
type
typedef keyword
typeid operator
typename keyword
unsigned specifier
union keyword
using keyword
virtual specifier
void keyword
volatile qualifier
wchar_t type
while statement
xor operator
xor_eq operator
Library Reference

adjacent_find function template
binary_search function template
copy function template
copy_backward function template
count function template
count_if function template
equal function template
equal_range function template
fill function template
fill_n function template
find function template
find_end function template
find_first_of function template
find_if function template
for_each function template
generate function template
generate_n function template
includes function template
inplace_merge function template
iter_swap function template
lexicographical_compare function template
lower_bound function template
make_heap function template
max function template
max_element function template
merge function template
min function template
min_element function template
mismatch function template
next_permutation function template
nth_element function template
partial_sort function template
partial_sort_copy function template
partition function template
pop_heap function template
prev_permutation function template
push_heap function template
random_shuffle function template
remove function template
remove_copy function template
remove_copy_if function template
remove_if function template
replace function template
replace_copy function template
replace_copy_if function template
replace_if function template
reverse function template
reverse_copy function template
rotate function template
rotate_copy function template
search function template
search_n function template
set_difference function template
set_intersection function template
set_symmetric_difference function template
set_union function template
sort function template
sort_heap function template
stable_partition function template
stable_sort function template
swap function template
swap_ranges function template
transform function template
unique function template
unique_copy function template
upper_bound function template

bitset class template
bitset::reference class
operator& function template
operator| function template
operator^ function template
operator >>function template
operator<< function template

assert macro
NDEBUG macro

isalnum function
isalpha function
iscntrl function
isdigit function
isgraph function
islower function
isprint function
ispunct function
isspace function
isupper function
isxdigit function
tolower function
toupper function

EDOM macro
EILSEQ macro
ERANGE macro
errno macro

DBL_DIG macro
DBL_EPSILON macro
DBL_MANT_DIG macro
DBL_MAX macro
DBL_MAX_10_EXP macro
DBL_MAX_EXP macro
DBL_MIN macro
DBL_MIN_10_EXP macro
DBL_MIN_EXP macro
FLT_DIG macro
FLT_EPSILON macro
FLT_MANT_DIG macro
FLT_MAX macro
FLT_MAX_10_EXP macro
FLT_MAX_EXP macro
FLT_MIN macro
FLT_MIN_10_EXP macro
FLT_MIN_EXP macro
FLT_RADIX macro
FLT_ROUNDS macro
LDBL_DIG macro
LDBL_EPSILON macro
LDBL_MANT_DIG macro
LDBL_MAX macro
LDBL_MAX_10_EXP macro
LDBL_MAX_EXP macro
LDBL_MIN macro
LDBL_MIN_10_EXP macro
LDBL_MIN_EXP macro


CHAR_BIT macro
CHAR_MAX macro
CHAR_MIN macro
INT_MAX macro
INT_MIN macro
LONG_MAX macro
LONG_MIN macro
MB_LEN_MAX macro
SCHAR_MAX macro
SCHAR_MIN macro
SHRT_MAX macro
SHRT_MIN macro
UCHAR_MAX macro
UINT_MAX macro
ULONG_MAX macro
USHRT_MAX macro

LC_ALL macro
LC_COLLATE macro
LC_CTYPE macro
LC_MONETARY macro
LC_NUMERIC macro
LC_TIME macro
lconv structure
localeconv function
NULL macro
setlocale function

abs function
acos function
asin function
atan function
atan2 function
ceil function
cos function
cosh function
exp function
fabs function
floor function
fmod function
frexp function
HUGE_VAL macro
ldexp function
log function
log10 function
modf function
pow function
sin function
sinh function
sqrt function
tan function
tanh function

abs function template
arg function template
complex class template
complex template specialization
complex template specialization
complex template specialization
conj function template
cos function template
cosh function template
exp function template
imag function template
log function template
log10 function template
norm function template
operator+ function template
operator- function template
operator* function template
operator/ function template
operator== function template
operator!= function template
operator<< function template
operator>> function template
polar function template
pow function template
real function template
sin function template
sinh function template
sqrt function template
tan function template
tanh function template

jmp_buf type
longjmp function
setjmp function

raise function
SIG_DFL macro
SIG_ERR macro
SIG_IGN macro
SIGABRT macro
SIGFPE macro
SIGILL macro
SIGINT macro
SIGSEGV macro
SIGTERM macro
sig_atomic_t type
signal function

va_arg macro
va_end macro
va_list type
va_start macro

NULL macro
offsetof macro
ptrdiff_t type
size_t type

_IOFBF macro
_IOLBF macro
_IONBF macro
BUFSIZ macro
clearerr function
EOF macro
fclose function
feof function
ferror function
fgetc function
fgetpos function
fgets function
FILE type
FILENAME_MAX macro
fopen function
FOPEN_MAX macro
fpos_t type
fprintf function
fputc function
fputs function
fread function
freopen function
fscanf function
fseek function
fsetpos function
ftell function
fwrite function
getc macro
getchar macro
gets function
L_tmpnam macro
NULL macro
perror function
printf function
putc macro
putchar macro
puts function
remove function
rename function
rewind function
SEEK_CUR macro
SEEK_END macro
SEEK_SET macro
setbuf function
setvbuf function
size_t type
sprintf function
sscanf function
stderr macro
stdin macro
stdout macro
TMP_MAX macro
tmpfile function
tmpnam function
ungetc function
vfprintf function
vprintf function
vsprintf function

abort function
abs function
atexit function
atof function
atoi function
atol function
bsearch function
calloc function
div function
div_t type
exit function
EXIT_FAILURE macro
EXIT_SUCCESS macro
free function
getenv function
labs function
ldiv function
ldiv_t type
malloc function
MB_CUR_MAX function
mblen function
mbstowcs function
mbtowc function
NULL macro
qsort function
rand function
RAND_MAX macro
realloc function
size_t type
srand function
strtod function
strtol function
strtoul function
system function
wctomb function
wcstombs function

memchr function
memcmp function
memcpy function
memmove function
memset function
NULL macro
size_t type
strcat function
strchr function
strcmp function
strcoll function
strcpy function
strcspn function
strerror function
strlen function
strncat function
strncmp function
strncpy function
strpbrk function
strrchr function
strspn function
strstr function
strtok function
strxfrm function

asctime function
clock function
clock_t type
CLOCKS_PER_SEC macro
ctime function
difftime function
gmtime function
localtime function
mktime function
NULL macro
size_t type
strftime function
time function
time_t type
tm struct

btowc function
fgetwc function
fgetws function
fputwc function
fputws function
fwide function
fwprintf function
fwscanf function
getwc macro
getwchar macro
mbrlen function
mbrtowc function
mbsinit function
mbsrtowcs function
mbstate_t type
NULL macro
putwc macro
putwchar macro
size_t type
swprintf function
swscanf function
tm struct
ungetwc function
vfwprintf function
vswprintf function
vwprintf function
WCHAR_MAX macro
WCHAR_MIN macro
wcrtomb function
wcscat function
wcschr function
wcscmp function
wcscoll function
wcscpy function
wcscspn function
wcsftime function
wcslen function
wcsncat function
wcsncmp function
wcsncpy function
wcspbrk function
wcsrchr function
wcsrtombs function
wcsspn function
wcsstr function
wcstod function
wcstok function
wcstol function
wcstoul function
wcsxfrm function
wctob function
WEOF macro
wint_t type
wmemchr function
wmemcmp function
wmemcpy function
wmemmove function
wmemset function
wprintf function
wscanf function

iswalnum function
iswalpha function
iswcntrl function
iswctype function
iswdigit function
iswgraph function
iswlower function
iswprint function
iswpunct function
iswspace function
iswupper function
iswxdigit function
towctrans function
towlower function
towupper function
wctrans function
wctrans_t type
wctype function
wctype_t type
WEOF macro
wint_t type

deque class template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
swap function template specialization

bad_exception class
exception class
set_terminate function
set_unexpected function
terminate function
uncaught_exception function
unexpected function

basic_filebuf class template
basic_fstream class template
basic_ifstream class template
basic_ofstream class template
filebuf class
fstream class
ifstream class
ofstream class
wfilebuf class
wfstream class
wifstream class
wofstream class

binary_function class template
binary_negate class template
bind1st function template
bind2nd function template
binder1st class template
binder2nd class template
const_mem_fun_ref_t class template
const_mem_fun_t class template
const_mem_fun1_ref_t class template
const_mem_fun1_t class template
divides class template
equal_to class template
greater class template
greater_equal class template
less class template
less_equal class template
logical_and class template
logical_not class template
logical_or class template
mem_fun function template
mem_fun_ref function template
mem_fun_ref_t class template
mem_fun_t class template
mem_fun1_ref_t class template
mem_fun1_t class template
minus class template
modulus class template
multiplies class template
negate class template
not1 function template
not2 function template
not_equal_to class template
plus class template
pointer_to_binary_function class template
pointer_to_unary_function class template
ptr_fun function template
unary_negate class template
unary_function class template

resetiosflags function
setbase function
setfill function template
setiosflags function
setprecision function
setw function

basic_ios class template
boolalpha function
dec function
fixed function
fpos class template
hex function
internal function
ios_base class
ios_base::event type
ios_base::event_callback type
ios_base::failure class
ios_base::fmtflags type
ios_base::Init class
ios_base::iostate type
ios_base::openmode type
ios_base::seekdir type
left function
noboolalpha function
noshowbase function
noshowpoint function
noshowpos function
noskipws function
nounitbuf function
nouppercase function
oct function
right function
scientific function
showbase function
showpoint function
showpos function
skipws function
streamoff type
streamsize type
unitbuf function
uppercase function


cerr variable
cin variable
clog variable
cout variable
wcerr variable
wcin variable
wclog variable
wcout variable

basic_iostream class template
basic_istream class template
basic_istream::sentry class
iostream class
istream class
operator>> function template
operator>> function template
wiostream class
wistream class
ws function

advance function template
back_insert_iterator class template
back_inserter function template
bidirectional_iterator_tag class
distance function template
forward_iterator_tag class
front_insert_iterator class template
front_inserter function template
input_iterator_tag class
insert_iterator class template
inserter function template
istream_iterator class template
istreambuf_iterator class template
iterator class template
iterator_traits class template
iterator_traits template specialization
iterator_traits template specialization
ostream_iterator class template
ostreambuf_iterator class template
output_iterator_tag class
random_access_iterator_tag class
reverse_iterator class template

float_denorm_style type
float_round_style type
numeric_limits class template

list class template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
swap function template

codecvt class template
codecvt_base class
codecvt_byname class template
collate class template
collate_byname class template
ctype class template
ctype class
ctype_base class
ctype_byname class template
ctype_byname class
has_facet function template
isalnum function template
isalpha function template
iscntrl function template
isdigit function template
isgraph function template
islower function template
isprint function template
ispunct function template
isspace function template
isupper function template
isxdigit function template
locale class
locale::category type
locale::facet class
locale::id class
messages class template
messages_base class
messages_byname class template
money_base class
money_get class template
money_put class template
moneypunct class template
moneypunct_byname class template
num_get class template
num_put class template
numpunct class template
numpunct_byname class template
time_base class
time_get class template
time_get_byname class template
time_put class template
time_put_byname class template
tolower function template
toupper function template
use_facet function template

map class template
multimap class template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
swap function template

allocator class template
allocator class
auto_ptr class template
get_temporary_buffer function template
operator== function template
operator!= function template
raw_storage_iterator class template
return_temporary_buffer function template
uninitialized_copy function template
uninitialized_fill function template
uninitialized_fill_n function template

bad_alloc class
nothrow object
operator delete
operator new
set_new_handler function

accumulate function template
adjacent_difference function template
inner_product function template
partial_sum function template

basic_ostream class template
basic_ostream::sentry class
endl function template
ends function template
flush function template
operator<< function template
ostream class
wostream class

operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
priority_queue class template
queue class template

multiset class template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
set class template
swap function template

basic_istringstream class template
basic_ostringstream class template
basic_stringbuf class template
basic_stringstream class template
istringstream class
ostringstream class
stringbuf class
stringstream class
wistringstream class
wostringstream class
wstringbuf class
wstringstream class

operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
stack class template

domain_error class
invalid_argument class
length_error class
logic_error class
out_of_range class
overflow_error class
range_error class
runtime_error class
underflow_error class

basic_streambuf class template
streambuf class
wstreambuf class

basic_string class template
char_traits class template
char_traits class
char_traits class
getline function template
operator+ function template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
operator<< function template
operator>> function template
string class
swap function template
wstring class

istrstream class
ostrstream class
strstream class
strstreambuf class

bad_cast class
bad_typeid class
type_info class

make_pair function template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
pair class template
rel_ops namespace

abs function template
acos function template
asin function template
atan function template
atan2 function template
cos function template
cosh function template
exp function template
gslice class
gslice_array class template
indirect_array class template
log function template
log10 function template
mask_array class template
operator* function template
operator/ function template
operator+ function template
operator- function template
operator& function template
operator| function template
operator^ function template
operator>> function template
operator<< function template
operator&& function template
operator|| function template
operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
pow function template
sin function template
sinh function template
slice class
slice_array class template
sqrt function template
tan function template
tanh function template
valarray class template

operator== function template
operator!= function template
operator< function template
operator<= function template
operator> function template
operator>= function template
swap function template
vector class template
vector class
vector::reference class
Compiler Extensions
Borland C++ Builder and Kylix
GNU Compiler Collection
Microsoft Visual C++
Projects
Blitz++
Boost
STLport
Glossary
Index