A
alessio211734
Hi All,
I execute this code on visual studio 2005 and in debug session my compiler
stay blocked on the return istruction of test function for 50 sec.
If I remove this line "facesAttributes.ip=l.end();" code run correcty.
What's wrong?!?
#include <map>
#include <list>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
class ShortestTriangleAttribute
{
public:
std::list<int>::iterator ip;
};
class fastMeshAttribute
{
public:
fastMeshAttribute(){};
fastMeshAttribute(std::list<int> & l)
{
std::list<int>::iterator it;
facesAttributes.resize(200000);
for (int i=0;i<facesAttributes.size();i++)
{
facesAttributes.ip=l.end();
}
};
~fastMeshAttribute()
{
int a=0;
};
std::vector<ShortestTriangleAttribute> facesAttributes;
};
bool test()
{
std::list<int> l1;
l1.push_back(1);
l1.push_back(2);
l1.push_back(3);
fastMeshAttribute fast(l1);
return true;
};
int main()
{
test();
return 0;
}
I execute this code on visual studio 2005 and in debug session my compiler
stay blocked on the return istruction of test function for 50 sec.
If I remove this line "facesAttributes.ip=l.end();" code run correcty.
What's wrong?!?
#include <map>
#include <list>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
class ShortestTriangleAttribute
{
public:
std::list<int>::iterator ip;
};
class fastMeshAttribute
{
public:
fastMeshAttribute(){};
fastMeshAttribute(std::list<int> & l)
{
std::list<int>::iterator it;
facesAttributes.resize(200000);
for (int i=0;i<facesAttributes.size();i++)
{
facesAttributes.ip=l.end();
}
};
~fastMeshAttribute()
{
int a=0;
};
std::vector<ShortestTriangleAttribute> facesAttributes;
};
bool test()
{
std::list<int> l1;
l1.push_back(1);
l1.push_back(2);
l1.push_back(3);
fastMeshAttribute fast(l1);
return true;
};
int main()
{
test();
return 0;
}