This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem using a vector of pointer to member functions
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: problem using a vector of pointer to member functions
- From: "Deno, Emerson" <edeno at blackrock dot com>
- Date: Thu, 27 Jul 2000 15:28:46 -0400
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