Which of the following is an arithmetic unary functor?

Ngân Lam

New member
Which of the following is an arithmetic unary functor?
A. logical_not<T> f;
B. logical_and<T> f;
C. logical_or<T> f;
D. negate<T> f;
 
Answer: d
Explanation: logical_and and logical_or requires two arguments to act upon whereas negate and logical_not requires only one argument but logical_not produces only logical results, therefore, will not work on arithmetic values whereas negate works with all types of values.
 

Tìm kiếm

Back
Top