S
slurper
i have the following
class sequence {
public:
sequence (const sequence& mysequence, const int newjob) {
job_sequence(mysequence.job_sequence)
job_sequence.push_back(newjob);
...
}
vector<int> job_sequence;
}
what i want is: if i have a sequence object, i want to be able to create a
new object that copies the job_sequence within it and adds another job to
the job_sequence vector.
question: i assume that when i call the constructor for sequence-class, that
first of all the constructor for "vector<int> job_sequence" will be called
( is this wrong? i assume that when i construct an object, the constructors
of all data-members will be called). next: is it ok to call
"job_sequence(mysequence.job_sequence)" in the constructor of sequence?
this last statement says that the constructor of vector<int> should be
called, right? can i call the constructor with the other vector as an
argument, even though the vector object was already constructed (with
default constructor, which i assume, is an empty vector?
tx
class sequence {
public:
sequence (const sequence& mysequence, const int newjob) {
job_sequence(mysequence.job_sequence)
job_sequence.push_back(newjob);
...
}
vector<int> job_sequence;
}
what i want is: if i have a sequence object, i want to be able to create a
new object that copies the job_sequence within it and adds another job to
the job_sequence vector.
question: i assume that when i call the constructor for sequence-class, that
first of all the constructor for "vector<int> job_sequence" will be called
( is this wrong? i assume that when i construct an object, the constructors
of all data-members will be called). next: is it ok to call
"job_sequence(mysequence.job_sequence)" in the constructor of sequence?
this last statement says that the constructor of vector<int> should be
called, right? can i call the constructor with the other vector as an
argument, even though the vector object was already constructed (with
default constructor, which i assume, is an empty vector?
tx