Stroustrup: C++ Glossary
placement delete - See explicit call of destructor.
placement new - a version of the new operator where the user can add arguments to guide allocation. The simplest form, where the object is placed in a specific location, is supported by the standard library. Example. For example, placement new is used in the implementation of standard library containers. See also: explicit call of destructor. TC++PL 10.4.11, E.3.1, D&E 10.4.
POD - "Plain Old Data" - (roughly) a class that doesn't contain data members that would be illegal in C. A POD can therefore be used for data that needs to be share with C functions. A POD can have non-virtual member functions.
pointer - an object holding an address or 0. TC++PL 2.3.3, 5.1, D&E 9.2.2.1, 11.4.4.
policy object - an object used to specify guide decisions (e.g. the meaning of "less than") or implementation details (e.g. how to access memory) for an object or an algorithm. See also trait, facet. TC++PL 13.4, 24.4.1.
polymorphism - providing a single interface to entities of different types. virtual functions provide dynamic (run-time) polymorphism through an interface provided by a base class. Overloaded functions and templates provide static (compile-time) polymorphism. TC++PL 12.2.6, 13.6.1, D&E 2.9.
postfix operator - a unary operator that appears after its operand. For example var++.
prefix operator - a unary operato that appears before its operand. For example, &var.
preprocessor - the part of a C++ implementation that removes comments, performs macro substitution and #includes. Avoid using the preprocessor whenever possible. See also: macro, #include, inline, const, template, namespace. TC++PL 7.8, 9.2.1, D&E 18.
priority_queue - standard library queue where a priority determines the order in which an element reaches the head of the queue. TC++PL 17.3.3.
private - access control keyword. See private member, private base.
private base - a base class declared private in a derived class, so that the base's public members are accessible only from that derived class. TC++PL 15.3.2, D&E 2.10.
private member - a member accessible only from its own class. TC++PL 2.5.2, 10.2.2, 15.3, D&E 2.10.
procedural programming - programming using procedures (functions) and data structures (structs). See also: data abstraction, object-oriented programming, generic programming, multi-paradigm programming. TC++PL 2.3.
program - a set of translation units complete enough to be made executable by a linker. TC++PL 9.4.
programming language - artificial language for expressing concepts and general algorithms in a way that lends itself to solving problems using computers. There do not appear to be a general consensus on what a programming language is or should be. TC++PL 1.3.2, 2.1-2, D&E page 7.
prohibiting operations - operations can be rendered inaccessible by declaring them private; in this way default operations, such as construction, destruction, and copying can be disallowed for a class. TC++PL 11.2.2, D&E 11.4.
proprietary language - language owned by an organization that is not an official standards organization, such as ISO; usually manipulated by its owner for commercial advantage.
protected - access control keyword. See protected member, protected base.
protected base - a base class declared protected in a derived class, so that the base's public and protected members are accessible only in that derived class and classes derived from that. TC++PL 15.3.2, D&E 13.9.
protected member - a member accessible only from classes derived from its class. TC++PL 15.3.1, D&E 13.9.
protection - see encapsulation.
protection model - the mechanisms for access control. See public, private, protected, friend. TC++PL 15.3, D&E 2.10.
public - access control keyword. See public member, public base.
public base - a base class declared public in a derived class, so that the base's public members are accessible to the users of that derived class. TC++PL 15.3.2, D&E 2.3.
public member - a member accessible to all users of a class. TC++PL 2.5.2, 10.2.2, 15.3, D&E 2.10.
pure object-oriented language - programming language claiming to support only object-oriented programming. C++ is designed to support several programming paradigms, including traditional C-style programming, data abstraction, object-oriented programming, and generic programming. For a longer explanation, read Why C++ isn't just an object-oriented programming language. See also: hybrid language.
pure virtual function - virtual function that must be overridden in a derived class. Indicated by the curious =0 syntax. A pure virtual function can be defined in the class where it is declared pure, but needn't be and usually isn't. A class with at least one pure virtual function is an abstract class. TC++PL 12.3. D&E 13.2.1.
push_back() - member function that adds an element at the end of a standard container, such as vector, thereby increasing the container's size by one. Example. TC++PL 3.7.3, 16.3.5, E.3.4.
put function - see <<.
qualified name - name qualified by the name of its enclosing class or namespace using the scope resolution operator ::. For example, std::vector or ::main. TC++PL 4.9.3, 8.2.1, 10.2.4, 15.2.1, 15.2.2, D&E 3.11.3.
queue - standard library first-in-first-out sequence. TC++PL 17.3.2.
RAII - see resource acquisition is initialization.
random number generator - function or function object producing a series of pseudorandom numbers according to some distribution. TC++PL 22.7.
raw memory - see uninitialized memory.
realloc() - C standard allocation function. Use vector and push_back() instead.
recursion - a function calling itself, hopefully with different arguments so that the recursion eventually ends with a call for which the function doesn't call itself. See also: iteration. TC++PL 7.1.1.
reference - an alternative name for an object or a function. See also: operator overloading, call-by-reference. TC++PL 5.4.1, D&E 3.7.
regression testing - systematically checking that a new version of a program doesn't break correct uses of a previous version of the program.
reinterpret_cast - a type conversion operation that reinterprets the raw memory of an object as a value of another type. The result of a reinterpret_cast can only be portably used after being converted back into its original type. Use only as a last resort. See also: cast. TC++PL 6.2.7, D&E 14.3.3.
resource - any entity that a program acquires and releases. Typical examples are free store, file handles, threads, sockets. See also: resource acquisition is initialization, exception safety, basic guarantee, resource management. TC++PL 14.4, E.2-3 D&E 16.5.
resource acquisition is initialization - A simple technique for handling resources in programs using exceptions. One of the keys to exception safety. Example. TC++PL 14.4, E.3 D&E 16.5.
resource leak - programming error causing a resource not to be released. See also: resource acquisition is initialization, basic guarantee. TC++PL 14.4, E.2-3 D&E 16.5.
resource management - a way of acquiring and releasing a resource, such as memory, thread, or file. See also: resource acquisition is initialization, auto_ptr, vector. TC++PL 14.4, D&E 10.4.
resumption semantics - In some languages, but not C++, an exception handler can respond by telling the thrower to resume (``just carry on as if the problem hadn't happened"). This looks like a good idea in some cases, but in general leads to contorted code because of unfortunate dependencies between separate levels of abstraction. See also: termination semantics. TC++PL 14.4.5, D&E 16.6.
return type relaxation - Allowing a virtual function returning a B* or a B& to be overridden by a function with a return type D* or D&, provided B is a public base of D. See also: overriding. TC++PL 15.6.2, D&E 13.7.
reverse iterator - iterator for iterating through a sequence in reverse order. TC++PL 19.2.5.
Ritchie - Dennis Ritchie is the designer and original implementer of C. Co-author of Kernighan & Ritchie: "The C programming Language".
RTFM - "Read The Manual" (The 'F' is silent). Usually a very good idea.
RTTI - see Run Time Type Information.
run time type information - information about a type available at run time through operations on an object of that type. See also: dynamic_cast, typeid(), and type_info. TC++PL 15.4, D&E 14.2.
rvalue - an expression that may appear on the right-hand side of an assignment, but not of the left-hand side; for example, 7. D&E 3.7.1.
scope - a region of source text delimited by curly braces: { ... }, a list of function or template parameters, or all of a translation unit outside other scopes. See also: block, namespace, global scope. TC++PL 2.9.4.
SDE - Software Development Environment. An environment of editors, compilers, tools, libraries, etc. used by a programmer to produce software. There are many SDEs for C++, but no standard SDE.
selection-statement - if-statement or switch-statement. TC++PL 6.3.2.
semantics - the rules specifying the meaning of a syntactically correct construct of a program. For example, specifying the actions taken to perform a for-statement or an object definition.
separate compilation - the practice of compiling parts of a program, called translation units, separately and then later linking the results together using a linker. This is essential for larger programs. See also: linkage, header file, one definition rule. TC++PL 2.4.1, 9.1. D&E 2.5.
separately compiled - see separate compilation.
sequence adapter - a class that provides a modified interface to another. For example, a standard library stack is an adapter for a more flexible data structure such as a vector. See also: adapter, stack, queue, priority_queue. TC++PL 17.3.
set - standard library associative container
short - integer of a size less than or equal to the size of an int. TC++PL 4.4.
sibling class - two classes are siblings if a class is (directly or indirectly) derived from them both and one is not derived from the other. Note that this is a rather inclusive definition of "sibling class" in that is does not require that the siblings have the same immediate derived class (I didn't want to introduce a notion of "cousin classes"). See also: dynamic_cast, crosscast.
signature - the set of parameter types for a function; that is, the function's type ignoring its return type. This is a confusingly specialized definition compared to other programming languages where "signature" means "function type".
Simula - ancestor of C++ designed by Ole-Johan Dahl and Kristen Nygaard; the source of the C++ class concept. TC++PL 1.4, 2.6.2, D&E 1.1, 3.1.
single dispatch - the technique of choosing the member function to be invoked based on the object used in the call. See also: double dispatch.
size of an object - the number of bytes required to represent an object. See also sizeof, alignment. TC++PL 4.6.
sizeof - operator yielding the size of an object.
smart pointer - user-defined type providing operators like a function, such as * and ++, and with a semantics similar to pointers. See also: iterator. Sometimes smart a pointer is called a handle. TC++PL 11.10-11, 13.6.3.1, 19.3, 25.7, D&E 11.5.1
software - a collection of programs
sort() - standard library algorithm for sorting a random access sequence, such as a vector or an array. Example comparing sort() to qsort(). TC++PL 18.7.1.
source file - .c file or header.
specialization - a class or function generated from a template by supplying a complete set of template arguments. TC++PL 13.2.2, 13.5, D&E 15.10.3.
stack - (1) memory used to hold local variables for a function. (2) standard library first-in-last-out sequence. TC++PL 10.4.3, 17.3.1, D&E 2.3, 3.9.
Standard C++ - C++ as defined by ISO.
standard header - header for standard library facility. Included using the "#include< ... >" syntax. TC++PL 9.2.2, 16.1.2.
standard library - The library defined in the C++ standard. Contains strings, stream I/O, a framework of containers and algorithms, support for numerical computation, support for internationalization, the C standard library, and some language support facilities. See also: complex, valarray, locale. TC++PL 16-22, D, E.
standards committee - see C++ standards committees.
statement - the basic unit controlling the execution flow in a function, such as if-statement, while-statement, do-statement, switch-statement, expression statement, and declaration. TC++PL 6.3.
static - (1) keyword used to declare a class member static; meaning allocated in static memory. For a member function, this implies that there is no this pointer. (2) keyword used to specify that a local variable should be allocated in static memory. (3) deprecated: keyword used to specify that a global name should not be visible from other translation units. TC++PL 7.1.2, 10.2.4, 10.4.8-9.
static member - member of a class for which there is only one copy for the whole program rather than one per object. TC++PL 10.2.4, D&E 13.4.
static member function - a member function that need not be called for an object of the class. TC++PL 10.2.4, D&E 13.4.
static memory - memory allocated by the linker. TC++PL 10.4.3, D&E 2.3, 2.11.1, 3.9, 11.4.2.
static type - the type of an object as known to the compiler based on its declaration. See also: dynamic type.
static type safety - type safety enforced before a program starts executing (at compile time or at static link time).
static variable - variable allocated in static memory. TC++PL 7.1.2, 10.2.4, 10.4.3, D&E 3.9.
static_cast - a type conversion operation that converts between related types, such as pointer types within a class hierarchy and between enumerations and integral types. See also: cast, dynamic_cast. TC++PL 6.2.7, 15.4.2.1, D&E 14.3.2.
Stepanov - Alex Stepanov is the original designer and implementer of the STL. D&E 11.15.2.
STL - the "Standard Template Library" by Alex Stepanov, which became the basis for the containers, algorithms, and iterators part of the ISO C++ standard library. TC++PL 15-19.
strcmp() - a C-style standard library function for comparing C-style strings.
stream I/O - see iostream.
string - standard-library type representing a sequence of characters, support by convenient operators, such as == and +=. The general form of of strings, basic_string, supports strings of different kinds of characters. TC++PL 3.5, 20.
string stream - stream attached to a string. See also, stringstream, istringstream, ostringstream. TC++PL 21.5.3.
stringstream - a string stream for input and output.
strong guarantee - the guarantee that an exception thrown by an operation leaves every object in the state in which it was before the start of the operation. Builds on the basic guarantee. See also exception safety, nothrow guarantee, and basic guarantee. TC++PL E.2.
Stroustrup - see Bjarne Stroustrup.
strstream - deprecated ancestor of stringstream.
struct - class with members public by default. Most often used for data structures without member functions or class invariants, as in C-style programming. TC++PL 5.7, 10.2.8, D&E 3.5.1.
subclass - a derived class.
subtype - see derived class. See also: public base.
suffix operator - a postfix operator.
superclass - a base class.
switch-statement - statement selecting among many alternatives based on an integer value. TC++PL 6.3.2.
syntax - the set of gramatical rules specifying how the text of a program must be composed. For example, specifying the form of a declaration or the form of a for-statement.
TC++PL - Bjarne Stroustrup: The C++ Programming Language (Special Edition). Addison Wesley. 2000.
template - class or function parameterized by a set of types, values, or templates. See also template instantiation, specialization, template class, template function. TC++PL 2.7, 13, D&E 15.
template argument - an argument to a template.
template argument constraint - see constraint.
template class - class parameterized by types, values, or templates. The template arguments necessary to identify the class to be generated for the class template must be provided where a template class is used. For example "vector<int> v;" generates a vector of ints from the vector template. See also template. TC++PL 13.2, D&E 15.3.
template definition - declaration of a template class or of a template function including a function body.
template function - function parameterized by types, values, or templates. The function to be generated from a template function can usually be deduced from the function arguments in a call. For example, "sort(b,e)" generates "sort<vector::iterator>(b,e)" from the sort() template function if b and e are standard library vector iterators. If a template argument cannot be deduced, it must be provided through explicit qualification. See also template. TC++PL 13,3, D&E 15.6.
template instantiation - the process of creating a specialization from a template. TC++PL 13.2.2, D&E 15.10.
template parameter - a parameter of a template.
terminate() - If an exception is thrown but no handler is found, terminate() is called. By default, terminate() terminates the program. If program termination is unacceptable, a user can provide an alternative terminate() function. If you are worried about uncaught exceptions, make the body of main() a try-block. TC++PL 14.7.
termination semantics - a somewhat ominous terminology for the idea that throwing an exception "terminates" an operation and returns through the function call chain to a handler. The handler can initiate any error handling it likes, including calling the function that caused the exception again (presumably after fixing the problem that caused the problem). What a handler can't do is simply tell the thrower to just carry on; by the time the handler is invoked we have returned from the block/function that threw and all blocks/functions that led to it from the handler's try-block. See also: resumption semantics. TC++PL 14.4.5, D&E 16.6.
ternary operator - an operator taking three operands, such as ?:.
testing - systematically verifying that a program meets its specification and systematically searching for error.
this - pointer to the object for which a non-static member function is called. TC++PL 10.2.7, D&E 2.5.2.
throw - operation for interrupting the normal flow of control and returning to an appropriate exception handler identifyed by the type of the exception throw. See also: catch, exception handling. TC++PL 8.3.1, 14.3, D&E 16.3.
trait - a small policy object, typically used to describe aspects of a type. For example, iterator_trait specifies the types resulting from operations on an iterator T. TC++PL 19.2.2.
translation unit - a part of a program that can be separately compiled. TC++PL 9.1.
trigraph - alternative representation for C++ representation characters that doesn't exist in every national character set, such as {, }, [, ], and #: ??<, ??>, ??(, ??), and ??=. TC++PL C.3.1.
true - bool value; converts to 1. TC++PL 4.2, D&E 11.7.2.
try - keyword used to start a try-block.
try-block - a block, prefixed by the keyword try, specifying handlers for exceptions. See also: catch, exception handling. TC++PL 8.3.1,14.3, D&E 16.3.
two-phase lookup - a somewhat complicated mechanism used in compilation of templates. Names that do not depend on a template parameter are looked up (and bound) early, i.e., when the template template definition is first seen ("phase 1 lookup"). Names that depend on a template parameter are looked up late, i.e. during template instantiation ("phase 2 lookup") so that the lookup can find names relating to actual template arguments. TC++PL C::13.8.
type - a built-in type or a user-defined type. A type defines the proper use of a name or an expression. TC++PL 2.3.1, 4.1.
type checking - the process of checking that every expression is used according to its type. the compiler checks every expression based on the declared types of the names involved. TC++PL 7.2-3, 24.2.3, D&E 2.3, 2.6, 3.10, 3.15, 9.2.2.1.
type conversion - producing a value of one type from a value of another type. A type conversion can be an implicit conversion or an explicit conversion. See also: user-defined type conversion, cast. TC++PL 6.2.7.
type safety - the property that an object can be accessed only according to its definition. C++ approximates this ideal. A programmer can violate type safety by explicitly using a cast, by using an uninitialized variable, by using a pointer that doesn't point to an object, by accessing beyond the end of an array, and by misusing a union. For low-level systems code, it can be necessary to violate type safety (e.g. to write out the byte representation of some objects), but generally type safety must be preserved for a program to be correct and maintainable.
type system - the set of rules for how objects can be used according to their types. See also: type checking.
typedef - synonym for some type declared using the keyword typedef.
typeid() - operator returning basic type information. TC++PL 15.4.4, D&E 14.2.5.
typename - (1) an alternative to "class" when declaring template arguments; for example, "template<typename T> void f(T);" (2) a way of telling a compiler that a name is meant to name a type in template code; for example "template<class T> void f(T a) { typename T::diff_type x = 0; ... }". TC++PL C::13.5.
type_info - class containing basic run time type information. TC++PL 15.4.4, D&E 14.2.5.1.
unary operator - an operator taking one operand, such as ! and unary *.
uncaught exception - Exception for which no handler was found. Invokes terminate(), which by default terminates the program. TC++PL 14.7.
undefined - an aspect of C++'s semantics for which no reasonable behavior is required. An example is dereferencing a pointer with the value zero. Avoid undefined behavior. See also: implementation defined. TC++PL C.2.
uninitialized memory - memory that hasn't been initialized to hold a specific value of a type. TC++PL 19.4.4.
union - a struct with all members allocated at the same offset within an object. The language does not guarantee type safety for all uses of unions. Primarily used to save space. TC++PL C.8.2.
upcast - a cast from a derived class to one of its bases. See also: downcast, crosscast. TC++PL 15.4.
user-defined type - Class or enumeration. A programmer can define meanings for operators for user-defined types. See also: operator overloading. TC++PL 6.2, 11, D&E 3.6, 11.7.1.
user-defined type conversion - a user can define conversions either as constructors or conversion operators. These conversions are applied explicitly or implicitly just like built-in conversions. TC++PL 11.3.5, 11.4, D&E 3.6.1, 3.6.3.
using - see using-directive and using-declaration.
using-declaration - declaration of a local synonym for a name in another namespace or class. Example of using-declaration used to simplify overloading. See also: overloading, argument-based lookup. TC++PL 8.2.2. D&E 17.4.
using-directive - directive making a namespace accessible. See also: argument-based lookup. TC++PL 8.2.3. D&E 17.4.
valarray - standard library numeric vector type supporting vector operations. TC++PL 22.4.
value - the bits of an object interpreted according to the objects type.
value return - The semantics of function return is to pass a copy of the return value. The copy operation is defined by the return type's copy constructor. TC++PL 7.4.
variable - named object in a scope. TC++PL 2.3.1, 10.4.3, D&E 2.3.
variable definition - declaration of a named object of a data type without an extern specifier.
vector - standard library template providing contiguous storage, re-sizing and the useful push_back() functions for adding elements at the end. Vector is the default container. See also: map, multimap, list, deque. TC++PL 3.7.1, 16.3.
virtual - keyword used to declare a member function virtual.
virtual base - a base that is shared by all classes in a class hierarchy that has declared it virtual. TC++PL 15.2.4, D&E 12.3, 12.4.1.
virtual constructor - a constructor cannot be virtual, because to create an object, we need complete information of its type. "virtual constructor" is the name of a technique for calling a virtual function to create an object of an appropriate type. Example. TC++PL 12.4.4, 15.6.2.
virtual destructor - a destructor declared virtual to ensure that the proper derived class destructor is called if an object of a derived class is deleted through a pointer to a base class. If a class has any virtual functions, it should have a virtual destructor. Example. TC++PL 12.4.2, D&E 10.5.
virtual member function - a member function that a derived class can override; the primary mechanism for run-time polymorphism in C++. A virtual member function is sometimes called a method. See also: overriding, pure virtual function. TC++PL 2.5.4, 2.5.5, 12.2.6, D&E 3.5, 12.4.
virtual-function pointer - a pointer to a class' virtual function table.
virtual-function table - table of all virtual functions for a class. The most common way of implementing virtual functions is to have each object of a class with virtual functions contain a virtual function pointer pointing to the class' virtual function table.
visitor pattern - a way of using double dispatch to simulate virtual calls without adding new virtual functions.
Visual C++ - Microsoft's implementation of C++ together with proprietary libraries for Windows programming in an IDE.
void - a keyword used to indicate an absence of information. TC++PL 4.1.1, 4.7.
void* - pointer to void; that is, a pointer to an object of unknown type; also called pointer to raw memory. A void* cannot be used or assigned without a cast. TC++PL 5.6, D&E 11.2.1, 11.2.3.
volatile - attribute of a declaration telling the compiler that an entity can have its value changed by extralinguistic means; for example, a real time clock: "extern volatile const long clock;". Limits optimizations. TC++PL A.7.1.
vptr - see virtual-function pointer.
vtbl - see virtual-function table.
wchar_t - wide character type. Used to hold characters of character sets that require more than a byte to represent, such as unicode. TC++PL 4.3, C.3.3. See also: large character sets, universal character name.
WG21 - a common abbreviation of the name of the ISO C++ standards committee.
while-statement - a loop statement presenting its condition "at the top". For example, while (cin>>var) vec.push_back(var);
whitespace - characters that a represented only by the space they take up on a page or screen. The most common examples are space (' '), newline ('\n'), and tab ('\t').
word - a number of bytes that on a given machine is particularly suied to holding an integers or a pointer. On many machines, an object must be aligned on a word boundary for acceptable performance. An int is typically a stored in a word. Often, a word is 4 bytes. See also: alignment. TC++PL 4.6.
xor - synonym for ^, the bitwise exclusive or operator TC++PL C.3.1.