A class of element used to be stored in a vector with other similar elements.
But now, it been removed and moved into its own field in the parent object.
public class OldParent {
vector<char> OldCollection = { 'A', 'B', 'C' };
}
public class NewParent {
char A = 'A';
vector<char> NewCollection = { 'B', 'C' };
}
The type that is held by the vector is significantly more complicated than a character, it is a vector of a normalish struct.
So the actual original type would look something like this:
struct ActualType {
string val1;
int val2;
double val3;
}
vector<vector<ActualType>> OldCollection;
// vector that has been separated out
vector<ActualType> SeparatedCollection;
The problem is that alot of the original code uses iterators over the whole old collection and a clean way I thought I could implement this change would be to create an iterator that would work as if the separated field was never separated. This way much of the original code would not have to be changed.
However, I am definitely open to new ideas as well.
Aucun commentaire:
Enregistrer un commentaire