R
robk
Hi,
Could someone know what is wrong with my code.
First of all what I'm trying to do.
I have (as can be seen) declared typedef's of vector STL.
I want each value in vector which is part of t_set of vectors to be part of
new vector
for future use.
But I want to reuse that variable vector by clearing or erasing the values
form it.
This is my part of code which ...
in skalar.h
....
typedef vector<double> t_vec;
typedef vector<t_vec> t_set;
....
in skalar.cpp
....
t_vec vector;
....
for (t_set::size_type i = 0; i < set_of_V.size(); i++)
{
t_gesture::const_iterator v = set_of_V.begin();
while (v != set_of_V.end())
{
vector.push_back(*v);
v++;
}
vector.clear(); // doesn't clear values
vector.erase(vector.begin(), vector.end()); // doesn't erase values
int a1 = static_cast<unsigned int>(vector.size()); // should be always the
same size!
}
// at the end of loop 'a1 = a1 * 5'
....
THX a lot
Could someone know what is wrong with my code.
First of all what I'm trying to do.
I have (as can be seen) declared typedef's of vector STL.
I want each value in vector which is part of t_set of vectors to be part of
new vector
for future use.
But I want to reuse that variable vector by clearing or erasing the values
form it.
This is my part of code which ...
in skalar.h
....
typedef vector<double> t_vec;
typedef vector<t_vec> t_set;
....
in skalar.cpp
....
t_vec vector;
....
for (t_set::size_type i = 0; i < set_of_V.size(); i++)
{
t_gesture::const_iterator v = set_of_V.begin();
while (v != set_of_V.end())
{
vector.push_back(*v);
v++;
}
vector.clear(); // doesn't clear values
vector.erase(vector.begin(), vector.end()); // doesn't erase values
int a1 = static_cast<unsigned int>(vector.size()); // should be always the
same size!
}
// at the end of loop 'a1 = a1 * 5'
....
THX a lot