|
|
Category: functors |
Component type: type |
downcast<BaseType,DerivedType> is a function object. Specifically, it is an Adaptable Unary Function, which means it is a function object that promotes a pointer to a reference. If f is a pointer to an object of class downcast<BaseType> and x is a pointer to an object of class BaseType, then f(x) returns dynamic_cast<DerivedType*>(x).
Defined in functors.h.
Parameter |
Description |
Default |
---|---|---|
BaseType |
The type of downcast's arguments. |
|
DerivedType |
The type of the result |
|
Adaptable Unary Function, DefaultConstructible
T has an operator*().
Unary_function<BaseType, DerivedType>.
Member |
Where defined |
Description |
---|---|---|
argument_type |
The type of the first argument: T |
|
result_type |
The type of the result: bool |
|
downcast() |
The default constructor. |
|
DerivedType operator()(const BaseType& x) |
Function call operator. The return value is dynamic_cast<Derived Type>(x). |
All of downcast's members are defined in the Adaptable Unary Function and DefaultConstructible requirements. downcast does not introduce any new members.
The function object overview, Adaptable Unary Function
Copyright
© 1999 Konrad-Zuse-Zentrum für Informationstechnik Berlin & Gary Powell All Rights Reserved.