delayed function in debug on visual studio 2005

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
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-space:pre fastMeshAttribute(){};<br/>
<span style="white-space:pre fastMeshAttribute(std::list<int> & l)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre std::list<int>::iterator it;<br/>
<span style="white-space:pre facesAttributes.resize(200000);<br/>
<span style="white-space:pre for (int i=0;i<facesAttributes.size();i++)<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre facesAttributes.ip=l.end();<br/>
<span style="white-space:pre }<br/>
};<br/>
<span style="white-space:pre ~fastMeshAttribute()<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre int a=0;<br/>
<span style="white-space:pre };<br/>
<span style="white-space:pre std::vector<ShortestTriangleAttribute> facesAttributes;<br/>
};<br/>
<br/>
bool test()<br/>
{<br/>
<span style="white-space:pre std::list<int> l1;<br/>
<br/>
<span style="white-space:pre l1.push_back(1);<br/>
<span style="white-space:pre l1.push_back(2);<br/>
<span style="white-space:pre l1.push_back(3);<br/>
<span style="white-space:pre fastMeshAttribute fast(l1);<br/>
<br/>
<span style="white-space:pre return true;<br/>
};<br/>
<br/>
<br/>
int main()<br/>
{<br/>
<span style="white-space:pre 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
 
Back
Top