One friend of mine showed very simple example:
#include <vector>
int main()
{
vector<int> v;
v.push_back( v[0] );
return 0;
}
It compiles, without any warnings. Problems with templates should be detected at compile time. What is your explanation of this strange behavior?
this seems like a runtime issue not a compile time issue to me. how is the compiler supposed to know how vector runs?