D
drawoh
Hi All,
I have a class that creates a thread, a mutex and a condition variable
in its constructor. I am writing a copy constructor for this class in
C++. I am doing a simple copy using the member initialization list.
First of all, does anyone have any opinion about whether this will work
fine. I think it will. I believe a copy constructor, when using a
member initialization list, does a memory copy of the object's members
to be copied. In which case I believe this should work.
Does anyone have a different opinion about the feasibility of this? The
reason I am trying to do this copy constructor is to push this class
into a vector container. But I am not sure about what will happen when
I try to erase this element from the vector. I am gonna do the
destructor later, I have the destructor figured out though.
Ciao, Draw
I have a class that creates a thread, a mutex and a condition variable
in its constructor. I am writing a copy constructor for this class in
C++. I am doing a simple copy using the member initialization list.
First of all, does anyone have any opinion about whether this will work
fine. I think it will. I believe a copy constructor, when using a
member initialization list, does a memory copy of the object's members
to be copied. In which case I believe this should work.
Does anyone have a different opinion about the feasibility of this? The
reason I am trying to do this copy constructor is to push this class
into a vector container. But I am not sure about what will happen when
I try to erase this element from the vector. I am gonna do the
destructor later, I have the destructor figured out though.
Ciao, Draw