unary_compose<AdaptableUnaryFunction1,AdaptableUnaryFunction2>
Categories: functors, adaptors
Component type: type
Calculates the negative of the sines of the elements in a vector, where the elements are angles measured in degrees. Since the C library function
vector<double> angles;
vector<double> sines;
const double pi = 3.14159265358979323846;
…
assert(sines.size() >= angles.size());
transform(angles.begin(), angles.end(), sines.begin(), compose1(negate<double>(), compose1(ptr_fun(sin), bind2nd(multiplies<double>(), pi / 180.))));
Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h. The
Parameter | Description |
---|---|
AdaptableUnaryFunction1 | The type of the first operand in the function composition operation. That is, if the composition is written |
AdaptableUnaryFunction2 | The type of the second operand in the function composition operation. That is, if the composition is written |
Adaptable Unary Function
unary_function<AdaptableUnaryFunction2::argument_type, AdaptableUnaryFunction1::result_type>
Member | Where defined | Description |
---|---|---|
argument_type | Adaptable Unary Function | The type of the function object's argument: |
result_type | Adaptable Unary Function | The type of the result: |
unary_compose(const AdaptableUnaryFunction1& f, const AdaptableUnaryFunction2& g); | unary_compose | See below. |
template <class AdaptableUnaryFunction1, class AdaptableUnaryFunction2> unary_compose<AdaptableUnaryFunction1, AdaptableUnaryFunction2> compose1(const AdaptableUnaryFunction1& op1, const AdaptableUnaryFunction2& op2); | unary_compose | See below. |
These members are not defined in the Adaptable Unary Function requirements, but are specific to