Problems with vector definition

Juan Roberto Jiménez Pérez rjimenez@ujaen.es
Tue Dec 28 12:06:00 GMT 2004


Hi,

i am trying to define a vector whose elements belong to class A:

class A{
 public:
    A(B b) {}

private:
   A(const A&);
   A& operator=(const A&);
}
where B is another class, doesn't matter its content.

The compiler (g++ v3.4.2) says that there is an error because A(const 
A&) is private when i define a vector:

B b;
vector<A>aVector(2, b);

Can you help me? 

Thanks in advance.
Roberto.




More information about the Gcc mailing list