EDN Admin
Well-known member
I have problem with this code example:
#include <map><br/>
#include <list><br/>
#include <vector><br/>
#include <algorithm><br/>
#include <string><br/>
#include <iostream><br/>
<br/>
<br/>
using namespace std;<br/>
<br/>
class ShortestTriangleAttribute<br/>
{<br/>
public:<br/>
std::list<int>::iterator ip;<br/>
};<br/>
<br/>
<br/>
class fastMeshAttribute<br/>
{<br/>
public:<br/>
<span style="white-spacere fastMeshAttribute(){};<br/>
<span style="white-spacere fastMeshAttribute(std::list<int> & l)<br/>
<span style="white-spacere {<br/>
<span style="white-spacere std::list<int>::iterator it;<br/>
<span style="white-spacere facesAttributes.resize(200000);<br/>
<span style="white-spacere for (int i=0;i<facesAttributes.size();i++)<br/>
<span style="white-spacere {<br/>
<span style="white-spacere facesAttributes.ip=l.end();<br/>
<span style="white-spacere }<br/>
};<br/>
<span style="white-spacere ~fastMeshAttribute()<br/>
<span style="white-spacere {<br/>
<span style="white-spacere int a=0;<br/>
<span style="white-spacere };<br/>
<span style="white-spacere std::vector<ShortestTriangleAttribute> facesAttributes;<br/>
};<br/>
<br/>
bool test()<br/>
{<br/>
<span style="white-spacere std::list<int> l1;<br/>
<br/>
<span style="white-spacere l1.push_back(1);<br/>
<span style="white-spacere l1.push_back(2);<br/>
<span style="white-spacere l1.push_back(3);<br/>
<span style="white-spacere fastMeshAttribute fast(l1);<br/>
<br/>
<span style="white-spacere return true;<br/>
};<br/>
<br/>
<br/>
int main()<br/>
{<br/>
<span style="white-spacere test();<br/>
return 0;<br/>
}<br/>
the function test() in debug ends after 50 seconds approximately. If I remove this line facesAttributes.ip=l.end() work correcty with no delay.
This happen only in debug session. I tried on another fresh install of same visual studio on vmbox and I get the same behavior.
my manifest:
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b </assemblyIdentity><br/>
Any ideas?
View the full article
#include <map><br/>
#include <list><br/>
#include <vector><br/>
#include <algorithm><br/>
#include <string><br/>
#include <iostream><br/>
<br/>
<br/>
using namespace std;<br/>
<br/>
class ShortestTriangleAttribute<br/>
{<br/>
public:<br/>
std::list<int>::iterator ip;<br/>
};<br/>
<br/>
<br/>
class fastMeshAttribute<br/>
{<br/>
public:<br/>
<span style="white-spacere fastMeshAttribute(){};<br/>
<span style="white-spacere fastMeshAttribute(std::list<int> & l)<br/>
<span style="white-spacere {<br/>
<span style="white-spacere std::list<int>::iterator it;<br/>
<span style="white-spacere facesAttributes.resize(200000);<br/>
<span style="white-spacere for (int i=0;i<facesAttributes.size();i++)<br/>
<span style="white-spacere {<br/>
<span style="white-spacere facesAttributes.ip=l.end();<br/>
<span style="white-spacere }<br/>
};<br/>
<span style="white-spacere ~fastMeshAttribute()<br/>
<span style="white-spacere {<br/>
<span style="white-spacere int a=0;<br/>
<span style="white-spacere };<br/>
<span style="white-spacere std::vector<ShortestTriangleAttribute> facesAttributes;<br/>
};<br/>
<br/>
bool test()<br/>
{<br/>
<span style="white-spacere std::list<int> l1;<br/>
<br/>
<span style="white-spacere l1.push_back(1);<br/>
<span style="white-spacere l1.push_back(2);<br/>
<span style="white-spacere l1.push_back(3);<br/>
<span style="white-spacere fastMeshAttribute fast(l1);<br/>
<br/>
<span style="white-spacere return true;<br/>
};<br/>
<br/>
<br/>
int main()<br/>
{<br/>
<span style="white-spacere test();<br/>
return 0;<br/>
}<br/>
the function test() in debug ends after 50 seconds approximately. If I remove this line facesAttributes.ip=l.end() work correcty with no delay.
This happen only in debug session. I tried on another fresh install of same visual studio on vmbox and I get the same behavior.
my manifest:
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b </assemblyIdentity><br/>
Any ideas?
View the full article