I was tracking the error in using __m128 (SSE vector) as the value in std :: unordered_map. This causes a segmentation error at runtime using mingw32 g ++ 4.7.2.
See the example below. Is there a reason why this should fail? Or maybe a workaround? (I tried to wrap the value in the class, but that didn't help.) Thanks.
#include <unordered_map>
#include <xmmintrin.h> // __m128
#include <iostream>
int main()
{
std::unordered_map<int,__m128> m;
std::cerr << "still ok\n";
m[0] = __m128();
std::cerr << "crash in previous statement\n";
return 0;
}
Compilation settings: g ++ -march = native -std = C ++ 11
source
share