This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problem using a vector of pointer to member functions


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]