error: must use '.*' or '->*' to call pointer-to-member function in '__unary_op (...)'
hi!
a little compiler error. pls help.
class A{
B get(unsigned int i);// return an B object whose state depend on
*this and i
std::vector<B> get_vec(){
std::vector<unsigned int> ints(n);
iota(ints.begin(),ints.end(),0);
std::vector<B> ret;
transform(
ints.begin(),
ints.end(),
back_inserter(ret),
get//or &get, *this.*get etc...
);
return ret;
};
private:
unsigned int n;
}
In function '_OutputIterator std::transform(_InputIterator,
_InputIterator, _OutputIterator, _UnaryOperation) [with _InputIterator
= __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned
int, std::allocator<unsigned int> > >, _OutputIterator =
std::back_insert_iterator<std::vector<B, std::allocator<B> > >,
_UnaryOperation = B (A::*)(unsigned int)]':
.../A.cpp:40: instantiated from here
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/
stl_algo.h:925: error: must use '.*' or '->*' to call pointer-to-
member function in '__unary_op (...)'