problem using a vector of pointer to member functions
Deno, Emerson
edeno@blackrock.com
Thu Jul 27 12:29:00 GMT 2000
i have a small program that doesn't compile under 2.95.3
here is the program
class SM2Sender
{
public:
SM2Sender();
void a_member_function(int i) { i--;}
void another_member_function(int i) { i++;}
private:
typedef void (SM2Sender::*RSLTFN)(int);
vector<SM2Sender::RSLTFN> _rslt_fns;
};
SM2Sender::SM2Sender()
{
_rslt_fns.push_back(&SM2Sender::a_member_function);
_rslt_fns.push_back(&SM2Sender::another_member_function);
}
compiler is
Reading specs from
/u1/edeno/latest-gcc/target/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/specs
gcc version 2.95.3 19991030 (prerelease)
message is
/u1/edeno/latest-gcc/target/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/../../
../../include/g++-3/stl_alloc.h: In instantiation of `allocator<void
(SM2Sender::*)(int)>':
sm2atom.C:16: instantiated from here
/u1/edeno/latest-gcc/target/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/../../
../../include/g++-3/stl_alloc.h:750: `allocator<void
(SM2Sender::*)(int)>::address(void (SM2Sender::* &)(int)) const' has already
been declared in `allocator<void (SM2Sender::*)(int)>'
has this error been previously reported?
thanks, emerson deno
More information about the Gcc-bugs
mailing list