Team LiB
Previous Section Next Section

Defined Terms


binary function object(二元函数对象)

A class that has a function-call operator and represents one of the binary operators, such as one of the arithmetic or relational operators.



An adaptor that binds an operand of a specified function object. For example, bind2nd(minus<int>(), 2) generates a unary function object that subtracts two from its operand.

绑定指定函数对象的一个操作数的适配器。例如,bind2nd(minus<int>(), 2) 产生一个一元函数对象,从操作灵长中减去 2。

class-type conversion(类类型转换)

Conversions to or from class types. Non-explicit constructors that take a single parameter define a conversion from the parameter type to the class type. Conversion operators define conversions from the class type to the type specified by the operator.


conversion operators(转换操作符)

Conversion operators are member functions that define conversions from the class type to another type. Conversion operators must be a member of their class. They do not specify a return type and take no parameters. They return a value of the type of the conversion operator. That is, operator int returns an int, operator Sales_item returns a Sales_item, and so on.

转换操作符是定义从类类型到另一类型的转换的成员函数。转换操作符必须是类的成员,而且不能指定返回类型不能接受形参。转换操作符返回转换操作符类型的值,即,operator int 返回 int,operator Sales_item 返回 Sales_item,依此类推。

function adaptor(函数适配器)

Library type that provides a new interface for a function object.


function object(函数对象)

Object of a class that defines an overloaded call operator. Function objects can be used where functions are normally expected.



An adaptor that negates the value returned by the specified function object. For example, not2(equal_to<int>()) generates a function object that is equivalent to not_equal_to<int>.

将指定函数对象的返回值求反的适配器。例如,not2(equal_to<int>()) 产生与 not_equal_to<int> 等价的函数对象。

smart pointer(智能指针)

A class that defines pointer-like behavior and other functionality, such as reference counting, memory management, or more thorough checking. Such classes typically define overloaded versions of dereference (operator*) and member access (operator->).


unary function object(一元函数对象)

A class that has a function-call operator and represents one of the unary operators, unary minus or logical NOT.


Team LiB
Previous Section Next Section