Glossary

Ru-Brd

This glossary is a compilation of the most important technical terms that are topic in this book. See [StroustrupGlossary] for a very complete, general glossary of terms used by C++ programmers.

abstract class

A class for which the creation of concrete objects ( instances ) is impossible . Abstract classes can be used to collect common properties of different classes in a single type or to define a polymorphic interface. Because abstract classes are used as base classes, the acronym ABC is sometimes used for abstract base class .



ADL

An acronym for argument-dependent lookup . ADL is a process that looks for a name of a function (or operator) in namespaces and classes that are in some way associated with the arguments of the function call in which that function (or operator name ) appears. For historical reasons, it is sometimes called extended Koenig lookup or just Koenig lookup (the latter is also used for ADL applied to operators only).



angle bracket hack

A nonstandard feature that allows a compiler to accept two consecutive > characters as two closing angle brackets (even though they normally require intervening whitespace ). For example, the expression vector<list<int>> is not valid C++ but is treated identically to vector<list<int> > by the angle bracket hack.



angle brackets

The characters < and > when they are used to delimit a list of template arguments or template parameters.



ANSI

An acronym for American National Standard Institute . A private, nonprofit organization that coordinates efforts to produce standard specifications of all kinds. A subcommittee called J16 is a driving force behind the standardization of C++. It cooperates closely with the international standards organization (ISO).



argument

A value (in a broad sense) that substitutes a parameter of a programmatic entity. For example, in a function call abs(-3) the argument is -3 . In some programming communities arguments are called actual parameters (whereas parameters are called formal parameters ).



argument-dependent lookup
See [ADL]
class

The description of a category of objects. The class defines a set of characteristics for any object. These include its data ( attributes , data members ) as well as its operations ( methods , member functions ). In C++, classes are structures with members that can also be functions and are subject to access limitations. They are declared using the keywords class or struct .



class template

A construct that represents a family of classes. It specifies a pattern from which actual classes can be generated by substituting the template parameters by specific entities. Class templates are sometimes called "parameterized" classes , although this term is more general.



class type

A C++ type declared with class , struct ,or union .



collection class

A class that is used to manage a group of objects. In C++, collection classes are also called containers .



constant-expression

An expression whose value is computed at compile time by the compiler. We sometimes call this a true constant to avoid confusion with constant expression (without hyphen). The latter includes expressions that are constant but cannot be computed at compile time by the compiler.



const member function

A member function that can be called for constant and temporary objects because it does not normally modify members of the *this object.



container
See [collection class]
conversion operator

A special member function that defines how an object can implicitly (or explicitly) be converted to an object of another type. It is declared using the form operator type () .



CRTP

An acronym for curiously recurring template pattern . This refers to a code pattern where a class X derives from a base class that has X as a template argument.



curiously recurring template pattern
See [CRTP]
decay

The implicit conversion of an array or a function to a pointer. For example, the string literal "Hello" has type char const[6] , but in many C++ contexts it is implicitly converted to a pointer of type char const* (which points to the first character of the string).



declaration

A C++ construct that introduces or reintroduces a name into a C++ scope.

See also [definition]


deduction

The process that implicitly determines template arguments from the context in which template are used. The complete term is template argument deduction .



definition

A declaration that makes the details of the declared entity known or, in the case of variables , that forces storage space to be reserved for the declared entity. For class types and function definitions, this amounts to declarations that include a brace - enclosed body. For external variable declarations, this means either a declaration with no extern keyword or a declaration with an initializer.



dependent base class

A base class that depends on a template parameter. Special care must be taken to access members of dependent base classes.

See also [two-phase lookup]


dependent name

A name the meaning of which depends on a template parameter. For example, A<T>::x is a dependent name when A or T is a template parameter. The name of a function in a function call is also dependent if any of the arguments in the call has a type that depends on a template parameter. For example, f in f((T*)0) is dependent if T is a template parameter. The name of a template parameter is not considered dependent, however.

See also [two-phase lookup]


digraph

A combination of two consecutive characters that are equivalent to another single character in C++ code. The purpose of digraphs is to allow the input of C++ source code with keyboards that lack certain characters. Although they are used relatively rarely, the digraph <: is sometimes accidentally formed when a left angle bracket is followed by a scope resolution operator ( :: ) without the required intervening whitespace .



dot-C file

A file in which definitions of variables and noninline functions are located. Most of the executable (as opposed to declarative) code of a program is normally placed in dot-C files. They are named dot-C files because they are usually named with a suffix such as .cpp , .C , .c , .cc ,or .cxx . See also header file and translation unit .



EBCO

An acronym for empty base class optimization . An optimization performed by most modern compilers whereby an "empty" base class subobject does not occupy any storage.



empty base class optimization
See [EBCO]
explicit instantiation directive

A C++ construct the sole purpose of which is to create a POI .



explicit specialization

A construct that declares or defines an alternative definition for a substituted template. The original (generic) template is called the primary template . If the alternative definition still depends on one or more template parameters, it is called a partial specialization . Otherwise, it is a full specialization .



expression template

A class template used to represent a part of an expression. The template itself represents a particular kind of operation. The template parameters stand for the kinds of operands to which the operation applies.



friend name injection

The process that makes a function name visible when it is declared only friend.



full specialization
See [explicit specialization]
function object
See [functor]
function template

A construct that represents a family of functions. It specifies a pattern from which actual functions can be generated by substituting the template parameters by specific entities. Note that a function template is a template and not a function. Function templates are sometimes called "parameterized" functions , although the latter term is more general.



functor

An object (also called a function object ) that can be called using the function call syntax . In C++, these are pointers or references to functions and classes with a member operator () .



header file

A file meant to become part of a translation unit through a #include directive. Such files often contain declarations of variables and functions that are referred to from more than one translation unit, as well as definitions of types, inline functions, templates, constants, and macros. They are usually named with a suffix like .hpp , .h , .H , .hh ,or .hxx . They are also called include files .

See also [dot-C file]
See also [translation unit]


include file
See [header file]
indirect call

A function call for which the called function is not known until the call actually occurs (at run time).



initializer

A construct that specifies how to initialize a named object. For example, in

 std::complex<float> z1 = 1.0, z2(0.0, 1.0); 

the initializers are = 1.0 and (0.0, 1.0) .



initializer list

A comma-separated list of expressions enclosed in braces used to initialize objects (or arrays). In constructors it can be used to define values to initialize members and base classes.



injected class name

The name of a class as it is visible in its own scope. For class templates, the name of the template is treated within the scope of the template as a class name if the name is not followed by a template argument list.



instance

The term instance has two meanings in C++ programming: The meaning that is taken from the object-oriented terminology is an instance of a class : An object that is the realization of a class. For example, in C++, std::cout is an instance of the class std:: ostream . The other meaning (and the one that is almost always intended in this book) is a template instance : A class, a function, or a member function obtained by substituting all the template parameters by specific values. In this sense, an instance is also called a specialization , although the latter term is often mistaken for explicit specialization .



instantiation

The process of creating a regular class, function, or member function from a template by substituting template parameters with actual values. The alternative sense of creating an instance (object) of a class is not used in this book

See also [( instance)]


ISO

World-wide acronym for International Organization for Standardization. An ISO workgroup called WG21 is a driving force behind the efforts to standardize and develop C++.



iterator

An object that knows how to traverse a sequence of elements. Often, these elements belong to a collection

See also [( collection class)]


linkable entity

A noninline function or member function, a global variable, or a static data member, including any such things generated from a template.



lvalue

In the original C language, an expression was called an lvalue if it could appear on the left of an assignment operator. Conversely, an expression that could appear only on the right of an assignment operator was called an rvalue . This definition is no longer appropriate in modern C and C++. Instead an lvalue can be thought of as a l ocator value : An expression that designates an object by name or address (pointer, reference, or array access) rather than by pure computation. Lvalues need not be modifiable (for example, the name of a constant object is a nonmodifiable lvalue ). All expressions that are not lvalues are rvalues . In particular, temporary objects created explicitly ( T() ) or as the result of function calls are rvalues.



member class template

A construct that represents a family of member classes. It is a class template declared inside another class or class template. It has its own set of template parameters (unlike a member class of a class template).



member function template

A construct that represents a family of member functions. It has its own set of template parameters (unlike a member function of a class template). It is very similar to a function template, but when all the template parameters are substituted, the result is a member function (instead of an ordinary function). Member function templates cannot be virtual.



member template

A member class template or a member function template .



nondependent name

A name that is not dependent on a template parameter.

See also [dependent name]
See also [two-phase lookup]


ODR

An acronym for one-definition rule . This rule places some restrictions on the definitions that appear in a C++ program. Section 7.4 on page 90 and Appendix A for details.



one-definition rule
See [ODR]
overload resolution

The process that selects which function to call when several candidates (usually all having the same name) exist.



parameter

A placeholder entity that is meant to be substituted with an actual "value" (an argument ) at some point. For macro parameters and template parameters, the substitution occurs at compile time. For function call parameters it happens at run time. In some programming communities parameters are called formal parameters (whereas arguments are called actual parameters ).

See also [argument]


parameterized class

A class template or a class nested in a class template. Both are parameterized because they do not correspond to a unique class until the template arguments have been specified.



parameterized function

A function or member function template or a member function of a class template. All are parameterized because they do not correspond to a unique function (or member function) until the template arguments have been specified.



partial specialization

A construct that declares or defines an alternative definition for certain substitutions of a template. The original (generic) template is called the primary template . The alternative definition still depends on template parameters. Currently, this construct exists only for class templates.

See also [explicit specialization]


POD

An acronym for "plain old data (type)." POD types are types that can be defined without certain C++ features (like virtual member functions, access keywords, and so forth). For example, every ordinary C struct is a POD.



POI

An acronym for point of instantiation . A POI is a location in the source code where a template (or a member of a template) is conceptually expanded by substituting template parameters with template arguments. In practice, this expansion does not need to occur at every POI.

See also [explicit instantiation directive]


point of instantiation
See [POI]
policy class

A class or class template the members of which describe configurable behavior for a generic component. Policies are normally passed as template arguments. For example, a sorting template may have an ordering policy. Policy classes are also called policy templates or just policies .

See also [traits template]


polymorphism

The ability of an operation (which is identified by its name) to apply to objects of different kinds. In C++, the traditional object-oriented concept of polymorphism (also called run-time or dynamic polymorphism) is achieved through virtual functions that are overridden in derived classes. In addition, C++ templates enable so-called static polymorphism.



precompiled header

A processed form of source code that can quickly be loaded by the compiler. The source code underlying a precompiled header must be the first part of a translation unit (in other words, it cannot start somewhere in the middle of a translation unit). Often, a precompiled header corresponds to a number of header files. Using precompiled headers can substantially improve the time needed to build a large application written in C++.



primary template

A template that is not a partial specialization .



qualified name

A name containing a scope qualifier ( :: ).



reference counting

A resource management strategy that keeps count of how many entities are referring to a particular resource. When the count drops to zero, the resource can be disposed of.



rvalue
See [lvalue]
source file

A header file or a dot-C file .



specialization

The result of substituting template parameters by actual values. A specialization may be created by an instantiation or by an explicit specialization . This term is sometimes mistakenly equated with explicit specialization .

See also [instance]


template

A construct that represents a family of classes or functions. It specifies a pattern from which actual classes or functions can be generated by substituting the template parameters by specific entities. In this book, the term does not include functions, classes, and static data members that are parameterized only by virtue of being members of a class template.

See also [class template]


template argument

The "value" substituted for a template parameter . This "value" is usually a type, although certain constant values and templates can be valid template arguments too.



template argument deduction
See [deduction]
template-id

The combination of a template name followed by template arguments in angle brackets (for example, std::list<int> ).



template parameter

A generic placeholder in a template. The most common kind of template parameter are type parameters , which represent types. Nontype parameters represent constant values of a certain type, and template template parameters represent class templates.



traits template

A template the members of which describe characteristics (traits) of the template arguments. Usually the purpose of traits templates is to avoid an excessive number of template parameters.

See also [policy class]


translation unit

A dot-C file with all the header files and standard library headers it includes using #include directives, minus the program text that is excluded by conditional compilation directives such as #if .For simplicity, it can also be thought of as the result of preprocessing a dot-C file.

See also [dot-C file]
See also [header file]


true constant
See [constant-expression.]
tuple

A generalization of the C struct concept such that members can be accessed by number.



two-phase lookup

The name lookup mechanism used for names in template. The "two phases" are (1) the phase during which a template definition is first encountered by a compiler, and (2) the instantiation of a template. Nondependent names are looked up only in the first phase, but during this first phase nondependent base classes are not considered. Dependent names with a scope qualifier ( :: ) are looked up only in the second phase. Dependent names without a scope qualifier may be looked up in both phases, but in the second phase only argument-dependent lookup is performed.



user -defined conversion

A type conversion defined by the programmer. It can be a constructor that can be called with one argument or a conversion operator . Unless it is a constructor declared with the keyword explicit , the type conversion can occur implicitly.



whitespace

In C++ this is the space that delimits the tokens (identifiers, literals, symbols, and so on) in source code. Besides the traditional blank space, new line, and horizontal tabulation characters, this also includes comments. Other whitespace characters (for example, the page feed control character) are sometimes also valid whitespace.



Ru-Brd


C++ Templates
C++ Templates: The Complete Guide
ISBN: 0201734842
EAN: 2147483647
Year: 2002
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net