Still a rubbish attempt at
http://sscce.org/
1 2 3 4 5 6 7 8
|
for ( uint32_t f=0;f<NumFrames;f++ )
{
df.m_Dats = new Data[ uidToDraw.size() ];
for ( auto ti = uidToDraw.begin(); ti != uidToDraw.end(); ++ti )
{
df.m_Dats[ dataidx++ ] = frame;
}
}
| |
You don't reset dataidx back to zero for your second pass through the f loop, so your second round of the ti loop uses a very non-zero dataidx value and keeps on incrementing from there on.
But how would we know, you've never shown how dataidx is declared or initialised.
Also, to stop your code looking like it's been dragged through a hedge, only use spaces for indentation (most modern editors deal with indentation very well).
A heady mix of spaces and tabs is a mess when posted.
> The program below executes OK
Sure it does.
But the very nature of "undefined behaviour" necessarily includes "doing what I expected".
> Is this vs2019 compiler bug and a known issue?
It's remarkable the number of wet behind the ears noobs who show up wondering whether it's a compiler bug (a compiler used by many 1000's of experienced professionals on a daily basis) is a possible alternative to their own code being wrong.