c++ - Can UnaryOperator be a member function when std::transform is called -



c++ - Can UnaryOperator be a member function when std::transform is called -

based on std::transform

template < class inputiterator, class outputiterator, class unaryoperator > outputiterator transform ( inputiterator first1, inputiterator last1, outputiterator result, unaryoperator op );

can op fellow member function? if so, how phone call it?

no (well, not directly). need utilize adaptor, either old std::mem_fun (together bind1st, iirc) or std::bind/boost::bind.

std::transform( xs.begin(), xs.end(), ys.begin(), std::bind(&class::member, &class_instance) );

c++ stl

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -