N
Naren
Hello All,
I get an unexpected behaviour for this
class D{
/*something*/
};
class B
{
D *ptr;
/* something more */
};
class A
{
vector<B> Blist;
};
in some function of class A
for(i=0;i<n;i++)
{
B obj;
Blist.push_back(obj); //throws an exception
}
i have defined copy constructors for all the classes and used explicit
keyword also in the declaration
I think STL makes a copy using this copy constrcutor to store internally.Plz
throw some light
Thaanx in advance
Rgds,
Naren.
I get an unexpected behaviour for this
class D{
/*something*/
};
class B
{
D *ptr;
/* something more */
};
class A
{
vector<B> Blist;
};
in some function of class A
for(i=0;i<n;i++)
{
B obj;
Blist.push_back(obj); //throws an exception
}
i have defined copy constructors for all the classes and used explicit
keyword also in the declaration
I think STL makes a copy using this copy constrcutor to store internally.Plz
throw some light
Thaanx in advance
Rgds,
Naren.