M
Milan
Just a few lines:
1: valarray<int> t(0, 10);
2: for (int i = 0; i < 10; ++i)
3: t = i;
4: valarray<int> t2 = t[slice(0, 3, 1)];
Line 4 causes a core dump with g++. Why?
Besides, if I change line 4 to the following:
valarray<int> t2 = (valarray<int>) t[slice(0, 3, 1)];
It works with Visual C++ but not with g++ (Compilation error. I forgot what
the message was). Is there any way to fix it?
Thanks.
Regards,
Milan.
1: valarray<int> t(0, 10);
2: for (int i = 0; i < 10; ++i)
3: t = i;
4: valarray<int> t2 = t[slice(0, 3, 1)];
Line 4 causes a core dump with g++. Why?
Besides, if I change line 4 to the following:
valarray<int> t2 = (valarray<int>) t[slice(0, 3, 1)];
It works with Visual C++ but not with g++ (Compilation error. I forgot what
the message was). Is there any way to fix it?
Thanks.
Regards,
Milan.